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