package lanqiaobei;
import java.util.*;
public class Main {
static Scanner in =new Scanner(System.in);
static final int N=1000;
static int k;
public static void main(String[] args) {
while(in.hasNext()){
k=in.nextInt();
LinkedList<Integer> st=new LinkedList<Integer>();
for (int i = 0; i <k; i++){
st.add(in.nextInt());
}
//最后会剩一个
while(st.size()!=1){
System.out.print(st.poll()+" ");
st.add(st.poll());
}
System.out.println(st.poll());
}
}
}
package lanqiaobei;import java.util.*;public class Main { static Scanner in =new Scanner(System.in); static final int N=1000; static int k; public static void main(String[] args) { wh