import java.util.Scanner;
public class 队 {
public static void main(String[] args) {
// TODO Auto-generated method stub
f1();
}
public static void f1(){
Scanner scanner=new Scanner(System.in);
int[] book=new int[100]; // 开辟一个较大的数组保存输入的数字
int head=1; // 队首
int tail=1; // 队尾加1
for (int i = 1; i <= 9; i++) {
book[tail]=scanner.nextInt();
tail++;
}
while(head


