Ants marked with paint form living life rafts in a mock flood. By tracking the color-coded ants, researchers were able to discover that ants return to the same locations in these rafts again and again.

It's weird enough that some ant species can work together to build living rafts in the event of a flood. Now, researchers find that individual ants have assigned seats on these life rafts — and they remember them again and again.

The floodplain-dwelling Alpine silver ants (Forica selysi) cluster together when the waters rise, creating a living life boat that surrounds and protects the colony's queen. Fire ant species make similar rafts, clinging to one another with their jaws, claws and sticky leg pads. Researchers call this process "self-assembly."

To understand how Alpine silver ants pull off this remarkably cooperative feat, researchers at the University of California, Riverside, and the University of Lausanne in Switzerland marked the abdomens of ants with different colors of paint. They then subjected the insects to mock floods and video-recorded them swarming into floating masses. [See Cool Photos of Crazy Ants]

The color-coding allowed the researchers to track where individual ants ended up in the rafts: base, middle, top or side. They found that the ants were remarkably consistent. Eighty percent stayed in one location in the raft for the full 30-minute experiment. More to the point, the ants returned to the same locations in the raft over the course of two separate floods (though ants in the base and along the sides of the raft sometimes swapped positions).

When pupae, or baby ants, were included in the rafts, the worker ants tucked these vulnerable members of the colony in the middle of the rafts. In these experiments, more worker ants ended up along the base and on the top of the assemblages than other spots, creating something like a floating ant sandwich.

It's unclear how the ants decide their positions in the rafts, the researchers wrote April 7 in the journal The Science of Nature. The positions may be based on size and job description, for example, with nurses (responsible for the pupae) on the bottom and slightly larger foragers on top. Age and even individual personality of each ant might also play a role, the researchers wrote.

"These elaborate rafts are some of the most visually stunning examples of cooperation in ants," study researcher Jessica Purcell, an entomologist at UC Riverside, said in a statement. "They are just plain cool. Although people have observed self-assemblages in the past, it's exciting to make new strides in understanding how individuals coordinate to build these structures."

Follow Stephanie Pappas on Twitter and Google+. Follow us @livescience, Facebook & Google+. Original article on Live Science.