google codejam magic_trick