n, m = map(int, input().split()) for _ in range(m): p, q, a, b = map(int, input().split()) assert a == 1 or b == 1 print(*[1 for _ in range(n)])