N, Q = map(int, input().split())
a = [0] * N
for _ in range(Q):
    L, R, T = map(int, input().split())
    a[L - 1:R] = [T] * (R - L + 1)
for e in a:
    print(e)

03dd01177afc6e4ddbbdace72b99d9e67c346a20
<mask token>

<mask token>
for _ in range(Q):
    L, R, T = map(int, input().split())
    a[L - 1:R] = [T] * (R - L + 1)
for e in a:
    print(e)

N, Q = map(int, input().split())
a = [0] * N
for _ in range(Q):
    L, R, T = map(int, input().split())
    a[L - 1:R] = [T] * (R - L + 1)
for e in a:
    print(e)
