char winner(char a[3][3])
{
    int i;
    char flag = 'O';
    for(i = 0; i < 3; i++)
    {
        if((a[0][i] == a[1][i] && a[1][i]== a[2][i]))					//列相等
        {
            flag = a[1][i];
            break;
        }
        else if((a[i][0] == a[i][1] && a[i][1]== a[i][2]))				//行相等
        {
            flag = a[i][1];
            break;
        }
    }
    if((a[0][0] == a[1][1] && a[1][1]== a[2][2]) ||                  
       (a[0][2] == a[1][1] && a[1][1]== a[2][0]))						//对角线相等
    {
        flag = a[1][1];
    }
    return flag;
}

int main()
{
    int i,j;
    char flag = 'O';
    char a[3][3] = {0};
    for(i = 0; i < 3; i++)
    {
        for(j = 0; j < 3; j++)
        {
            scanf("%c ", &a[i][j]);
        }
    }
    getchar();
    flag = winner(&a);
    if(flag == 'K')
    {
        printf("KiKi wins!\n");
    }
    else if(flag == 'B')
    {
        printf("BoBo wins!\n");
    }
    else
    {
        printf("No winner!\n");
    }
    return 0;
}