l = [i for i in range(1,21)]
for _ in range(10):
	a,b = map(int, input().split()); a-=1; b-=1
	l[a:b+1] = reversed(l[a:b+1])
print(*l)
be65e7b3b7bb5abcc6e75a3b7606222ae9fc287d
<mask token>

<mask token>
for _ in range(10):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    l[a:b + 1] = reversed(l[a:b + 1])
print(*l)

l = [i for i in range(1, 21)]
for _ in range(10):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    l[a:b + 1] = reversed(l[a:b + 1])
print(*l)

l = [i for i in range(1,21)]
for _ in range(10):
	a,b = map(int, input().split()); a-=1; b-=1
	l[a:b+1] = reversed(l[a:b+1])
print(*l)