5252: B3766 [语言月赛202305] 排排队,做游戏(入门)

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Input

Output

Sample Input Copy

8 4
72818 21895123 25718513 289523 52783 18520 295123 285952
1 2 3 5

Sample Output Copy

72818 285952 295123 52783 18520 289523 25718513 21895123

HINT