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