Some investments are better equipped to survive recessions and market corrections than others. A strong balance sheet helps a lot, and it's even better if management is willing and able to adapt to a changing business environment.

These are excellent qualities in the best of times as well. However, flexibility and a solid financial footing will separate the wheat from the chaff when the market turns bearish. These are the companies that will survive the longest and roughest of storms, looking like a winner amid the widespread wreckage on the other side.

So if you expect the economy to continue the downtrend of the last six months, you should consider grabbing a few shares of Micron Technology (MU 1.43%) and Alphabet (GOOG 9.97%) (GOOGL 10.31%) right now. These businesses come with heaping helpings of the game-changing features mentioned above, and the deal gets even sweeter when the stocks are trading at fire-sale prices.

A solid financial platform

Let's get the numbers out of the way first.

Google parent Alphabet has $20.9 billion of cash equivalents on its balance sheet, paired with just $14.8 billion in long-term debt. But that's not all. In a pinch, Alphabet could also sell off its marketable securities -- stocks, bonds, and other not-quite-cash assets -- valued at $113 billion at the end of March.

So Alphabet carries liquid assets worth approximately 8 times as much as its long-term debt. If the cash flow spigot suddenly shuts off, these reserves would carry the company through many years or even decades of dark times.

Memory-chip maker Micron should be a different story because it works in a different sector. Alphabet's operations are asset-light and highly profitable, while Micron invests billions of dollars in semiconductor manufacturing equipment every year. It's only fair to expect Micron's balance sheet to tilt heavily in the direction of massive debts and limited cash.

But the company plays a different tune. As of March 3, Micron carried $10.1 billion of cash and short-term investments against just $7 billion in long-term debt. Yes, Micron's debt leverage is a little bit less comfortable than Alphabet's, but the company is in excellent financial shape considering the asset-rich sector it's in.

Both Micron and Alphabet are also adding to their cash hoards, generating generous free cash flows every year:

GOOG Free Cash Flow Chart

GOOG and MU Free Cash Flow data by YCharts

Keeping an open mind

Flexibility is the other half of my formula for long-term success in any type of market.

I shouldn't need to remind you that Alphabet is the king of trying new ideas. Google's search and advertising services have made Alphabet one of the most valuable companies in the world, but management has long been planning for the next stage. The potential growth drivers of that stretch include the Waymo self-driving car business, health services from Verily Life Sciences, and high-speed internet connections by Google Fiber.

The proliferation of future business ideas not named Google is the reason behind the name change to Alphabet in 2015. By disconnecting the corporate name from the Google brand, Alphabet set itself up to become a cross-sector conglomerate in the long run.

In short, Alphabet keeps a stirringly open mind to new business ideas. Whatever comes next, the company will poke and prod at the new environment until it finds a healthy and profitable niche (or five). With the backing of that ultra-solid balance sheet, I see no reason why Alphabet shouldn't thrive through the next downturn and beyond.

Micron isn't quite as adventurous as Alphabet, of course. Once again, the company has invested many billions in a global chip-making infrastructure and you can't just flip a switch to run that business in a totally different direction.

But Micron has grown up from a smallish chipmaker in a highly fragmented industry to a leading supplier in a new era. There are only a couple of memory-chip companies left on the market after several rounds of pricing pressure, bankruptcies, buyouts, and consolidation. Micron has always emerged from these challenging cycles as a winner, picking up the ashes of its failed rivals in pennies-on-the-dollar bankruptcy auctions.

The mature version of the memory industry that you see today has also been good for Micron. The sector as a whole has started to slow down the boom-and-bust cycles of low chip supplies, massive factory investments, and oversupply. Micron's strategy these days is to increase its manufacturing capacity in line with rising demand for memory chips, and no more.

So Micron may not be leading the charge into unknown territory the way Alphabet does, but the company has a proven ability to adopt the right strategy for a variety of market conditions. That should keep Micron going strong for the long run, come chip shortages or low waters.