Solution to level 61 in Untrusted: http://alex.nisnevich.com/untrusted/