氵氵
#include<cstdio>
#include<stack>
using namespace std;
stack<int> q;
int main(int n,int m,int k){
scanf("%d%d",&n,&m);
while(m--){
n--;
scanf("%d",&k);
q.push(k);
}
while(!q.empty()){
printf("%d ",q.top());
q.pop();
}
while(n--) scanf("%d",&k),printf("%d ",k);
}