When floods sweep through the homes of fire ants, they either huddle into floating balls or build a tower reaching upward using the most immediate material available: themselves.

Often, these venomous insects build these temporary structures around blades of grass or other flimsy structures.

Don’t tell the French, but these terrifying towers share many characteristics with the Eiffel Tower – mainly that each element (ants and steel, receptively) of both “bears an equal load” of the structure’s weight, which is how they remain upright.

But unlike with the Iron Lady, ants don’t have Alexandre Gustave Eiffel designing their towers. They simply figure it out as they go, which leads to constant collapses until a wriggling, towering structure emerges.

Several researchers, including Georgia Institute of Technology engineering professor Craig Tovey, grew interested in how the ants manage such a feat, especially given that these towers are created by “thousands of purblind creatures whose brains have less than one ten-thousandth as many neurons as a human’s,” as Tovey wrote in an essay for the Conversation.

And, contrary to popular belief, they don’t share a “hive mind” – the queen does not issue orders. Each ant controls only itself.

To sate this curiosity, researchers gathered colonies of fire ants from Atlanta roadsides, and doped their water with “radiographic contract medium” that shows up on an X-ray. (If you’ve had an MRI, you’ve had to drink a similar substance so the doctors could get a close look at your veins). They then observed the ants build towers in small tubular containers, and used an X-ray to get a see what was going on inside the tower.

The results were published Wednesday in the journal Royal Society Open Science.

The researchers discovered, perhaps unsurprisingly, that the ants don’t have a grand plan a la Mr. Eiffel. As the paper stated, “The ants do not attempt to build this shape, but rather it emerges from a process of trial and error, with the most stable shape remaining standing.”

When beginning construction, they don’t, for example, know how wide the base of the tower will need to be. Still, they manage to construct one – and don’t crush each other in the process – by following some strict guidelines.

Specifically, the ants follow three simple rules:

— If there’s another ant standing on you, DON’T MOVE.

— If you’re standing on other ants, but no ant is standing on you, KEEP MOVING. You can move wherever you’d like.

— If there’s an opening next to some ants that aren’t moving, MOVE INTO THAT SPOT AND DON’T MOVE.

By following these rules, which are hard-wired in their minuscule brains, “The top layer is always formed atop what had just previously been the top layer. Being the narrowest, it consists of a ring of ants around the pole, each gripping its two horizontally adjacent ants,” the paper stated.

The structure that is created leaves most ants bearing the weight of three others.

“We found that ants can withstand 750 times their body weight without injury, but they seem to be most comfortable supporting three ants on their backs,” Tovey said in a news release. “Any more than three and they’ll simply give up, break their holds and walk away.”

But here’s the really remarkable thing: Once the tower is built, it begins sinking – but it never loses its shape. That’s because the ants on the bottom layer eventually tunnel out and climb back up the structure to form a new top layer.

But they do it slowly enough to never break the tower.

“Once the tower is built, the ants circulate through it while preserving its shape. We were surprised; we thought the ants would stop building their tower once its height was maximal,” Tovey wrote.

It’s unclear why this is, but it seemed like this allows the ants to take turns resting, before they again bear the weight of three other ants. It also creates tunnels where the ants can protect their young. Finally, it allows them to clean debris from the outside of the tunnel. (Most of this debris can’t get inside – the researchers found, for example, that a raindrop cannot penetrate the tower’s exterior.)

Either way, Tovey found it surprising.

“Every living organism I’ve studied has turned out to be more complicated than it seemed at first,” he wrote. “Understanding how simple rules can lead to elaborate and varied structures increases our respect for the power of evolution, and gives us ideas for how to design multifunctional self-assembling robot teams.”

Some of those designs might include programming “swarms of robots to one day work together in rescue operations, or to cross chasms and build structures on other planets,” as the Verge noted.