8 lines
188 B
Python
8 lines
188 B
Python
n, m = map(int,input().split())
|
|
arr = list(range(1,n+1))
|
|
temp = list()
|
|
for _ in range(m):
|
|
i, j = map(int, input().split())
|
|
temp = arr[i-1:j]
|
|
arr[i-1:j] = temp[::-1]
|
|
print(*arr) |