Magic Trick solutions

Magic Trick was solved using Erlang by 3 contestants. Solution sizes: average 6261 bytes (shortest: 717; longest: 11805).