#checker N,M=map(int,input().split()) assert 1<=N<=10**5,"Nが制約違反(N={})".format(N) assert 1<=M<=2*10**5,"Mが制約違反(M={})".format(M) for _ in range(M): u,v,l,a=map(int,input().split()) assert 0<=u<=N,"uが制約違反(u={})".format(u) assert 0<=u<=N,"vが制約違反(v={})".format(v) assert 1<=l<=pow(10,9),"lが制約違反(l={})".format(l) assert 1<=a<=pow(10,9),"aが制約違反(l={})".format(a) print("OK")