A robot is situated in an environment with heaps of stones. Everytime he gets somewhere he picks up one stone from that heap. To decide where he will go next, he looks around and determines the sizes of the heaps in the squares neighbouring directly horizontally or vertically. His programming tells him which heapsizes he prefers. He will never move to an empty square. In case multiple neighbouring squares have the highest priority, he can not choose and gets stuck. Program the robot such that he will at some point arrive at the grey endstation. Give the priorities of the heaps of different sizes from left to right from highest to lowest priority. More information.