import sys import heapq input = sys.stdin.buffer.readline N, Q = map(int, input().split()) MAX = 10 ** 9 h = [] queries = [[] for _ in range(N)] for _ in range(Q): l, r, b = map(int, input().split()) l -= 1 r -= 1 queries[l].append((-b, r)) ans = [MAX] * N for i in range(N): for q in queries[i]: heapq.heappush(h, q) if h: bm, r = heapq.heappop(h) if r < i: print(-1); exit() ans[i] = -bm if h: print(-1);exit() print(*ans)