Problem L: GESP 四 202409-编程2

Problem L: GESP 四 202409-编程2

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

Sample Input Copy

5
3 4 5 2 1
3
4 5
3 4
1 3

Sample Output Copy

1 3 4 5 2