Really ugly solution to tic-tac-tomek