After dropping 19% in 2022, the S&P 500 has started the new year off on a strong footing, rising over 9%. This positive performance might have sparked renewed interest among investors, who have been waiting on the sidelines for things to turn back around. If this sounds like you, then it's probably a good idea to figure out what to invest in right now for the long term. 

If you have $5,000 that you're ready to put to work in the stock market for your retirement, then look no further than these two dominant enterprises in which to equally split that investment.  

Costco 

With trailing 12-month net sales of $227 billion and a physical footprint of 845 warehouses scattered across the globe, Costco Wholesale (COST 0.17%) is the third-largest retailer in the world. This should come as no surprise, as the business has a fanatical customer base that frequents the stores because Costco has the lowest prices around. In fact, the membership renewal rate was a superb 92.5% in the U.S. and Canada and 90.4% worldwide in the latest quarter (ended in Nov. 20). Now that's true loyalty. 

Costco's sales grew double digits in fiscal 2021 and 2022, but a softer macroeconomic backdrop and difficult comparisons are starting to affect the business. In the month of December, net revenue increased 7% versus the prior-year period, which continued an ongoing slowdown. But with plans to open 24 net new warehouses this fiscal year, management sees a lot of growth potential ahead. 

What's probably most pressing on shareholders' minds is when Costco will raise its membership fees, currently at $60 for the Gold Star plan and $120 for the Executive plan. It's been almost six years since this last happened, and management has hinted that it will probably happen in 2023. This should be a boon for the company, as nearly all of the membership dues flow straight to the profit line. 

After rising 13% so far in 2023, Costco's stock now trades at a price-to-earnings (P/E) multiple of 39. This valuation places Costco at a premium to a chief rival like BJ's Wholesale Club, and it could initially cause investors to hesitate when it comes to buying the stock. This mentality is completely understandable. 

However, it's worth remembering just how durable a business Costco is. It will likely be doing the same thing in 20 years' time as it is today. That's a company that can be a solid foundation for anyone's portfolio. 

Nike 

In Nike's (NKE 0.66%) latest fiscal quarter (ended Nov. 30), revenue of $13.3 billion and earnings per share of $0.85 both beat Wall Street's expectations, sending the stock immediately higher.

It wasn't all good news, though, as Nike has been dealing with its fair share of challenges. In the most recent quarter, the inventory balance of $9.3 billion was 43% higher than the prior-year period despite a 17% jump in sales. And thanks to elevated promotional activity, the gross margin decreased 300 basis points to 42.9%. 

But I don't think this completely removes the business from investment consideration. I believe that Nike will work itself through the inventory glut, even if it takes a few quarters. Its popular footwear and apparel are always in high demand with consumers, which should ease any concerns about the strength of the brand. 

And in China, historically Nike's fastest-growing region, revenue dipped 3% in the quarter on a year-over-year basis. With the country starting to reopen following strict COVID lockdowns, investors can start to expect strong gains again. "We have remained committed to investing in greater China for the long term," CEO John Donahoe said on the earnings call. 

If we look past these near-term headwinds, it's still obvious just how powerful a brand Nike is. According to Piper Sandler's latest Taking Stock With Teens survey, Nike was the most popular footwear and clothing brand among the Gen Z demographic. That's a wonderful position to be in, one that is bolstered by genius marketing campaigns and athlete endorsements. 

Nike's stock is up 10% so far this year, and it now sells at a P/E ratio of 36. This looks expensive, but it's based on lower-than-normal profitability in the previous four quarters. Nike will probably be the leading apparel and footwear business decades from now, making it a worthy portfolio addition for someone investing with retirement in mind.