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