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