Files
CodeObject/zeta/py/completed/10811.py
2025-05-07 04:44:30 +09:00

8 lines
187 B
Python

N, M = map(int, input().split())
L = [i + 1 for i in range(N)]
for _ in range(M):
i, j = map(int, input().split())
L[i - 1:j] = reversed(L[i - 1:j])
print(" ".join(map(str, L)))