P28202 [洛谷] Tic-Tac-Toe I
普及-
题目描述

Problem Description

Xiao a and uim enjoy playing Tic-Tac-Toe against each other. Everyone knows how to play Tic-Tac-Toe, right? It's a game on a 3x3 grid where players place "O" and "X" (don't think too much about it), and the first one to form a line of 3 wins.

Since Xiao a is a bit slow, uim always lets him go first.

We represent the board positions with 9 numbers:

$$ \def\arraystretch{1.5} \begin{array}{|c|c|c|}\hline 1 & 2 & 3 \\\hline 4 & 5 & 6 \\\hline 7 & 8 & 9 \\\hline \end{array}$$

All game records are from finished games, either one player wins or it's a draw.

Today, they played for an entire afternoon, and Xiao a, wanting to improve his skills, recorded many game outcomes. He wants to know who won at the end of each game.

Input Format

A single line of numbers representing the sequence of moves. Xiao a always moves first.

Output Format

A single line. If Xiao a wins, output xiaoa wins.. If uim wins, output uim wins.. If it's a draw, output drew..

Sample Input and Output

Sample Input #1

5237649

Sample Output #1

xiaoa wins.

Sample Input #2

539128647

Sample Output #2

drew.
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
5237649
样例输出
xiaoa wins.