n, laser_l, laser_r = [ int(v) for v in input().split() ] laser_list = [[laser_l, laser_r]] object_list = [] xmax = 1280 ymax = 1680 xmin = 0 for i in range(n): xl,yu,xr,yd = [ int(v) for v in input().split() ] object_list.append([min(yd,ymax),max(xmin,xl),min(xr,xmax),i]) object_list = sorted(object_list,reverse = True) x_list = [ i for i in range(xmax+1)] hit_list = [0]*n for i in range(n): objectx = [0 for j in range(object_list[i][2]-object_list[i][1]+1)] if x_list[object_list[i][1]:object_list[i][2]+1] != objectx: hit_list[object_list[i][3]] = 1 x_list = x_list[:object_list[i][1]] + objectx + x_list[object_list[i][2]+1:] for i in range(n): print(hit_list[i])