I would say phono stage. To get the best from a cartridge you need a great tonearm. To get the most from a tonearm you need a great table. From a table, a phono.
But cartridges wear out fast. Tonearms don't. Tables don't. Phono stages don't. So if you are considering cost, get a great phono stage first. For example, I had a Rega 3 back when - sounded good for the day. With an ARC SP8, the system sang.
I had planned to buy forever speakers that day - Magnepan Tympani IVA. But the SP8 made more difference, so that's what I bought. YMMV