#! env/bin/local python3
# -*- coding: utf-8 -*-

conditions = []

n, m = map(int, input().split())
while True:
    try:
        conditions.append(list(map(int, input().split())))
    except EOFError:
        break

number: list = [0] * n

is_ok = True
for c in conditions:
    if number[c[0]-1] == 0 or number[c[0]-1] == c[1]:
        number[c[0]-1] = c[1]
    else:
        is_ok = False

if number[0] == 0:
    is_ok = False

if is_ok:
    print(*number)
else:
    print(-1)




