mod = 998244353 def main(): import sys input = sys.stdin.readline N, M = map(int, input().split()) ans = [1] * N print(*ans) for _ in range(M): p, q, a, b = map(int, input().split()) assert a * b <= 3 if __name__ == '__main__': main()