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