N,L,R=map(int,input().split()) A=[[-1]*1681 for i in range(1281)] for i in range(N): a,b,c,d=map(int,input().split()) for x in range(max(0,a),min(1281,c+1)): for y in range(max(0,b),min(1281,d+1)): A[x][y]=i ANS=[0]*N for x in range(L,R+1): for j in range(1680,-1,-1): if A[x][j]!=-1: ANS[A[x][j]]=1 break for ans in ANS: print(ans)