What is the best way to import warehouses when parents are in the same file to be imported?

As the title says. I have 300 warehouses to import. they are in a tree structure with many pointing to parent warehouses on the same import, but the import fails because the parents haven’t been created yet. Am I going to have to do this in multiple steps? Or am I missing something that would help me import them all in one shot?