N, L, R = map(int, input().split()) l = [] ans_l = [0 for i in range(N + 1)] for i in range(N): l.append(list(map(int, input().split()))) for i in range(L, R + 1): y_posi = 0 hit_n = N for ind, l_i in enumerate(l): if l_i[0] <= i <= l_i[2]: if y_posi <= l_i[3]: hit_n = ind y_posi = l_i[3] ans_l[hit_n] = 1 ans_l.pop() for l_i in ans_l: print(l_i)