#include <stdio.h> int main() { int i = 0, j = 0; int flag = 0; char arr[3][3] = { 0 }; for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { arr[i][j] = getchar(); getchar(); } } for (i = 0; i < 3; i++) { if (arr[i][0] == 'K' && arr[i][1] == 'K' && arr[i][2] == 'K') { flag = 1; break; } } for (i = 0; i < 3; i++) { if (arr[0][i] == 'K' && arr[1][i] == 'K' && arr[2][i] == 'K') { flag = 1; break; } } if (arr[0][0] == 'K' && arr[1][1] == 'K' && arr[2][2] == 'K') flag = 1; if (arr[0][2] == 'K' && arr[1][1] == 'K' && arr[2][0] == 'K') flag = 1; for (i = 0; i < 3; i++) { if (arr[i][0] == 'B' && arr[i][1] == 'B' && arr[i][2] == 'B') { flag = -1; break; } } for (i = 0; i < 3; i++) { if (arr[0][i] == 'B' && arr[1][i] == 'B' && arr[2][i] == 'B') { flag = -1; break; } } if (arr[0][0] == 'B' && arr[1][1] == 'B' && arr[2][2] == 'B') flag = -1; if (arr[0][2] == 'B' && arr[1][1] == 'B' && arr[2][0] == 'B') flag = -1; if (flag == 1) { printf("KiKi wins!\n"); } else if (flag == -1) { printf("BoBo wins!\n"); } else printf("No winner!\n"); return 0; }