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