#checker N=int(input()) A=list(map(int,input().split())) B=[] for _ in range(N): B.append(list(map(int,input().split()))) assert 1<=N<=18,"Nが制約違反(N={})".format(N) assert len(A)==N,"Aの長さがおかしい(長さ:{})".format(len(A)) for i,a in enumerate(A,1): assert 0<=a<=10**9,"A_{}が制約違反(A_{}={})".format(i,i,a) for i in range(N): assert len(B[i])==N,"B[i]の長さがおかしい".format(len(B)) assert B[i][i]==0,"B[{0}][{0}]=0でない(B[{0}][{0}]={1})".format(i+1,B[i][i]) for j in range(N): assert abs(B[i][j])<=10**9,"B[{0}][{1}]が制約違反(B[{0}][{1}]={2})".format(i+1,j+1,B[i][j]) C=[list(x) for x in zip(*B)] assert B==C,"Bが対称でない" print("OK")