n, q = map(int, input().split()) B = [list(map(int, input().split())) for _ in range(q)] INF = 10**9 B.sort(key=lambda x: (x[0], x[1])) A = [INF for _ in range(n)] min_ind = -1 for i in range(q): l, r, b = B[i] l -= 1 r -= 1 if l != min_ind: min_ind = l else: if b > A[min_ind]: print(-1) exit() min_ind += 1 if min_ind > r: print(-1) exit() A[min_ind] = b print(*A)