GoogleCodeJam 2013, Qualification Round, A. Tic-Tac-Toe-Tomek, small and large inputs AC.