f = Falsefor i in range(3): # 三行輸入 n = input().split() if "BILL" in n: print(i + 1, n.index("BILL") + 1) f = True breakif not f: print("NO")