Count the number of rocks in each room, and enter the door that is at that number's position on a clock. For example, if there are three rocks, you enter the east door; if there are six, you enter the south door; if there are nine, you enter the west door; if there are twelve, you enter the north door. Because of this, you may have to enter the same door you came from. If you enter the wrong door, i.e. one that doesn't match the number of rocks in the room, then you are transported to the beginning.
However, there are four item rooms in which there are, predictably, items. To access these rooms, you have to enter the door opposite the correct one. So if there were three rocks in a room, you would enter the door on the west instead of the one on the east, and so on. This may take some trial and error though, as there are a number of rooms, and only four item rooms. Thus, you will be returned back to the beginning a few times.
Good luck, and I hope my explanation wasn't too complicated.
EDIT: Gah, Scepgatr gave you the easy way. Beaten. =/