N,M = map(int, input().split())
nij = [i+1 for i in range(N)]
for i in range(M):
mij = list(map(int, input().split()))
for j in range((mij[1]-mij[0]+1)//2):
temp = nij[mij[0]+j-1]
nij[mij[0]+j-1] = nij[mij[1]-j-1]
nij[mij[1]-j-1] = temp
answer = ' '.join([str(x) for x in nij])
print(answer)