1 #include<iostream>
2 #include<cstdio>
3
4 using namespace std;
5
6 char board[4][4];
7
8 int main()
9 {
10 while(cin>>board[1][1])
11 {
12 int result = 0; //result=0:NO BODY; result=1:YOU; result=2:BEAR KID
13 for(int i = 1; i <= 3; i++)
14 for(int j = 1; j <= 3; j++)
15 {
16 if(i == 1 && j == 1)
17 continue;
18 cin>>board[i][j];
19 }
20 for(int i = 1; result == 0 && i <= 3; i++)
21 {
22 if(board[i][1] == board[i][2] && board[i][2] == board[i][3])
23 {
24 if(board[i][1] == '1')
25 result = 1;
26 else if(board[i][1] == '0')
27 result = 2;
28 }
29 }
30 for(int j = 1; result == 0 && j <= 3; j++)
31 {
32 if(board[1][j] == board[2][j] && board[2][j] == board[3][j])
33 {
34 if(board[1][j] == '1')
35 result = 1;
36 else if(board[1][j] == '0')
37 result = 2;
38 }
39 }
40 if(board[1][1] == board[2][2] && board[2][2] == board[3][3])
41 if(board[1][1] == '1')
42 result = 1;
43 else if(board[1][1] == '0')
44 result = 2;
45 if(board[1][3] == board[2][2] && board[2][2] == board[3][1])
46 if(board[1][3] == '1')
47 result = 1;
48 else if(board[1][3] == '0')
49 result = 2;
50 if(result == 0)
51 cout<<"NO BODY"<<endl;
52 else if(result == 1)
53 cout<<"YOU"<<endl;
54 else if(result == 2)
55 cout<<"BEAR KID"<<endl;
56 }
57 }