Tick-Tack-Toe 〜 横へな 2012.7.6

問題

三目並べ( tick-tack-toe )の手を入力とし、勝敗を出力する。

1 2 3
4 5 6
7 8 9

入力と出力の例

#入力出力
179538246x won.
235497162193x won.
361978543x won.
4254961323121x won.
56134278187x won.
64319581Foul : x won.
79625663381Foul : x won.
87975662Foul : x won.
92368799597Foul : x won.
1018652368566Foul : x won.
11965715o won.
1238745796o won.
13371929o won.
14758698769o won.
1542683953o won.
16618843927Foul : o won.
1736535224Foul : o won.
18882973Foul : o won.
19653675681Foul : o won.
209729934662Foul : o won.
21972651483927Draw game.
225439126787Draw game.
23142583697Draw game.
2442198637563Draw game.
25657391482Draw game.