We will prove any two robots can be moved to the same square. From that point on, they will always be on the same square. We can then similarly move
## Sun Life Financial Canadian Mathematical Olympiad
!
a third robot onto the same square as these two, and then a fourth, and so on, until all robots are on the same square.
Towards that end, consider two robots A and B. Let d(A,B) denote the minimum number of commands that need to be given in order to move A to the square on which B is currently standing. We will give a procedure that is guaranteed to decrease d(A,B). Since d(A,B) is a non-negative integer, this procedure will eventually decrease n to 0, which finishes the proof.
Let n=d(A,B), and let S={s1,s2,…,sn} be a minimum sequence of moves that takes A to the square where B is currently standing. Certainly A will not run into an impassable edge during this sequence, or we could get a shorter sequence by removing that command. Now suppose B runs into an impassable edge after some command si. From that point, we can get A to the square on which B started with the commands si+1,si+2,…,sn and then to the square where B is currently with the commands s1,s2,…,si−1. But this was only n−1 commands in total, and so we have decreased d(A,B) as required.
Otherwise, we have given a sequence of n commands to A and B, and neither ran into an impassable edge during the execution of these commands. In particular, the vector v connecting A to B on the grid must have never changed. We moved A to the position B=A+v, and therefore we must have also moved B to B+v. Repeating this process k times, we will move A to A+kv and B to B+kv. But if v=(0,0), this will eventually force B off the edge of the grid, giving a contradiction.