#checker T=int(input()) assert 1<=T<=300 for _ in range(T): K,X,Y=map(int,input().split()) A=list(map(int,input().split())) P=list(map(int,input().split())) assert 1<=K<=10**3 assert 0<=X<=10**18 assert 0<=Y<=10**18 assert len(A)==K assert len(P)==K for i in range(K): assert 1<=A[i]<=10**18 assert 1<=P[i]<=10**18 print("OK")