P26908 [AtCoder] ○✕ゲーム
普及
题目描述

Problem Description

The following rules are used for the ○✕ゲーム:

  1. First, create a grid with $ 1 $ row and $ 5 $ columns.
  2. Fill all squares with either o or x.
  3. If o appears consecutively for $ 3 $ or more squares horizontally, o wins.
  4. Otherwise, if x appears consecutively for $ 3 $ or more squares horizontally, x wins.
  5. If neither of these conditions is met, the game is a draw.

You are given the state of the grid after the filling is complete. The symbol written in the $ i $ -th square from the left is $ S_i $.
Determine the result of the ○✕ゲーム.

Input Format

The input is given from the standard input in the following format:

$ S_1S_2S_3S_4S_5 $

Output Format

Output o if o wins, x if x wins, and draw if the game is a draw.

Sample Input and Output

Sample Input #1

xooox

Sample Output #1

o

Sample Input #2

xxxxx

Sample Output #2

x

Sample Input #3

xoxxo

Sample Output #3

draw

Notes/Hints

Note

Discussion of this problem is prohibited until 18:00 JST on December 27, 2020. If discussed, legal action may be taken. It is acceptable to publish overall scores and certification levels after the exam, but please refrain from sharing information about which problems were solved.

Constraints

  • $ S_i $ is either o or x

Sample Explanation 1

Since o appears consecutively for $ 3 $ squares, o wins.

Sample Explanation 2

Since x appears consecutively for $ 5 $ squares, x wins.

Sample Explanation 3

Neither o nor x appears consecutively for $ 3 $ or more squares, so the game is a draw.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
xooox
样例输出
o