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