There are much worse ways to get investment ideas than following in the footsteps of the world's most successful investors. After all, billionaire investors like Warren Buffett, George Soros, and David Einhorn have beaten the market for years, in good times and bad.

Fortunately, these three legends have to file a document known as a 13F with the SEC every three months. These 13Fs show what they bought and sold in the last quarter. I previously discussed three stocks that these billionaires are buying. This time around, let's take a look at the companies they're giving up on.

Warren Buffett
Buffett became the second-richest person in the United States by investing for the long haul in great companies that he thinks will kick off profit for decades, rather than days.

Because Buffett embraces a long-term focus, keeping track of the stocks he sells through his company, Berkshire-Hathaway (NYSE:BRK-B), can be eye-opening.

In the most recent quarter, Berkshire reduced its stakes in a number of companies, but its biggest sale was National Oilwell Varco (NYSE:NOV), a company that builds equipment for oil and gas drilling.

A drop-off in oil prices led Berkshire to exit ExxonMobil in the fourth quarter of 2014, and it seems his pessimism toward energy companies continued in Q1. Overall, Buffett cut his position in National Oilwell Varco by 62%, leaving him with 1.98 million shares heading into Q2. Because we don't know the timing of Buffett's sale, it's possible that Berkshire's remaining shares in National Oilwell Varco will disappear from its holdings in Q2. The company's Q1 results, which were released at the end of April, did little to help its case: Sales slipped 15.6% quarter over quarter.

No one knows when energy prices will head high enough to respark equipment demand, and that seems to be a good enough reason for Buffett to step aside. Perhaps it's a good enough reason for you to stay away, too.

George Soros
Billionaire George Soros is a far more active investor than Buffett, but his revolving-door approach has still been incredibly successful. During his long tenure running the highly respected Quantum Fund, he racked up annualized returns of 30%.

Last quarter, Soros eliminated 34 positions from his portfolio, including Teva Pharmaceuticals (NYSE:TEVA). Teva Pharmaceuticals is a generic-drug goliath that also markets Copaxone, a multibillion-dollar therapy for multiple sclerosis.

Copaxone faces off against generic versions from competitors soon, and because it accounts for 20% of Teva Pharmaceuticals' sales, it's likely that Soros is content to sit on the sidelines for a bit and see how that competition shakes out.

That might be wise, but investors should also know that Teva Pharmaceuticals has already shifted many of its Copaxone patients to a long-lasting formulation that reduces how often the medicine needs to be taken. That long-lasting version still has patent protection, so the impact from generic Copaxone sales could be smaller than some investors fear.

David Einhorn
David Einhorn's investments have been closely scrutinized ever since Einhorn accurately predicted the demise of Wall Street's Lehman Brothers. In the first quarter, Einhorn's Greenlight Capital, which owns $8 billion in stocks, cast aside six companies.

The most notable of these six may be Aetna (NYSE:AET). Previously, Einhorn's position in the insurer was worth more than $150 million, making Aetna one of Einhorn's top 20 holdings. However, Einhorn's infatuation with health insurers has been waning, perhaps over fear that legal challenges to Obamacare subsidies could pose a risk to rising health insurance enrollment.

In the fourth quarter, Greenlight Capital sold Aetna's competitor, Cigna, and as of the end of Q1, the fund's exposure to the healthcare sector had dropped to 0%. That's a significant underweighting of the sector, which represents about 15% of the S&P 500, and it could suggest that Einhorn thinks the industry's impressive rally could be coming to an end. That's certainly possible, but investors may want to think hard before walking away from the healthcare sector, given that 10,000 aging baby boomers are turning 65 years old daily, and this demographic's healthcare needs will only grow with time.

Tying it together
Most investors should seek to buy and hold stocks for the long term, but it can be hard to tell which stocks are worth holding on to for decades. Trends can change, and investors' portfolios need to change with them. After all, plenty of buy-and-holders would have benefited from selling shares in companies like Radio Shack and Eastman-Kodak at some point along the way.

Although the companies that Buffett, Soros, and Einhorn ditched last quarter aren't likely to end up in the wastebasket like those two, the fact that some of the world's best investors have sold them should prompt investors to revisit their investment theses and make sure these stocks still fit into their long-term investing strategies.