Have many wifi devices "pass" a reading down the line.

I'm going to try to describe my topography. I need temperature readings from a bunch of cabins that are all in a line on the ridge of a hill. There is a building down the hill that has internet, but I don't really care about getting internet to each of these buildings that are 50 feet apart. What I was thinking is that I could have each arduino send its temperature down the line and each arduino would basically send its own temperature along with all the ones its received down the line to the end like a giant repeater.

My guess is that would mean that I would be putting a bunch of arduinos in some sort of ad-hoc mode and sending the temp data over wifi. Is there anyone who can point me in the right direction on how to do something like that?

I know the question is really general, but I'm pretty decent at figuring this sort of thing out once I know what to call it.