Source code from Google Code Jam 2013