1 line
519 B

To find the entrance to Headquarters, upon entering the first numbered room, go in any direction. Thenceforth, subtract the number of the previous room from the number of the current room. Take the last digit of the difference. If it is zero, go East; if one, go South; if two, Up; if three, North; if four, Down; if five, West. For example, the first numbered room is 64; the second is 105. The difference is 41, making the last digit one; you should go South in this case. Failure will return you to the antechamber.