It’s a race that has no end and triumphs can be fleeting. The contest for the world’s most valuable publicly traded company. In 2018, Apple, Amazon, and Microsoft ran head to head once again, with an unfashionable winner emerging amid a year of stock-market gyrations. Here’s how it unfolded:

Apple

Apple became the first trillion-dollar non-state-owned company in August, boosted by hope that the appetite for iPhones will remain bottomless. Around the October, as US stocks began to swoon and tech stocks were especially hit hard, those hopes began to fade. In November, Apple announced it would no longer break out how many individual devices it ships each quarter—which many took to be a bad sign—and had modest expectations for the holiday season.

Rumors swirled that Apple was cutting orders back for its newly launched iPhones, especially the XR. Was Peak iPhone upon us? As the chart shows, the company shed $190 billion in market cap in five weeks and continues to fall.

Amazon

The e-commerce giant also became a $1-trillion company—albeit briefly—in September. (The chart doesn’t show it because it was intraday and this is based on closing prices.) Like Apple, the stock remains up for the year, but has shed 22% in three months. The feeling that Amazon could eat every company in the world has turned. That has made the stock much more volatile; Amazon shares have experienced some wild swings this quarter. Perhaps that is why it is teaming up with Apple for the first time this holiday season.

Microsoft

The company founded by Bill Gates and Paul Allen has been the tortoise of the group. That changed since the October stocks rout began. Microsoft shares have tumbled a bit but nowhere near as much as the others. It overtook Apple and Amazon in market cap on Nov. 26, becoming the most valuable company in the world.

It is the first time its value has been higher than Apple’s for eight years; their rivalry, with Microsoft under Gates and Apple under Steve Jobs, defined the tech world for much of the 1980s and then again in the 2000s. Why? Microsoft is doing very well. It brought in more than $100 billion for the first time last year.

Under Satya Nadella, Microsoft has “increased revenue, profits and relevance by becoming even more Microsoft-y—doubling down on its products for businesses and slimming or ditching its efforts in the up-and-down areas of consumer technology like smartphones,” according to Bloomberg Opinion columnist Shira Ovide. At this rate, Microsoft could also end the year as the world’s most valuable public company for the first time since 2002.