n,m=map(int,input().split()) for _ in range(m): a,b=map(int,input().split()) if a < 0: print(-1) exit() print(*([1] * n))