The common tern breeds over a wider range of habitats than any of its relatives, nesting from the taiga of Asia to tropical shores, and at altitudes up to in Armenia, and in Asia. It avoids areas which are frequently exposed to excessive rain or wind, and also icy waters, so it does not breed as far north as the Arctic tern. The common tern breeds close to freshwater or the sea on almost any open flat habitat, including sand or shingle beaches, firm dune areas, salt marsh, or, most commonly, islands. Flat grassland or heath, or even large flat rocks may be suitable in an island environment. In mixed colonies, common terns will tolerate somewhat longer ground vegetation than Arctic terns, but avoid the even taller growth acceptable to roseate terns; the relevant factor here is the different leg lengths of the three species. Common terns adapt readily to artificial floating rafts, and may even nest on flat factory roofs. Unusual nest sites include hay bales, a stump above the water, and floating logs or vegetation. There is a record of a common tern taking over a spotted sandpiper nest and laying its eggs with those of the wader. Outside the breeding season, all that is needed in terms of habitat is access to fishing areas, and somewhere to land. In addition to natural beaches and rocks, boats, buoys and piers are often used both as perches and night-time roosts.