A general template for Google Code Jam problems.
Starting on Alien Language problem.
Simplest solution, using regex in Java.
Minor correction and solve the large input.