l = [] for i in range(3): l.extend(input().split()) lx = ['K', 'K', 'K'] ly = ['B', 'B', 'B'] m = {'K':'KiKi wins!', 'B':'BoBo wins!', 'O':'No winner!'} n = [l[0:3],l[3:6],l[6:9],l[0::3],l[1::3],l[2::3],l[::4],l[2:8:2], -1] for i in n: if i == lx or i == ly: print(m[i[0]]) break elif i == -1: print(m['O'])