Solution to GCJ 2014 Magic Trick