package yukicoder355; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); List list=new ArrayList<>(); for(int i=0;i<9;i++){ System.out.println(i+" "+i+" "+i+" "+i); int aa=sc.nextInt(); int bb=sc.nextInt(); if(!(aa==0&&bb==0)){ list.add(i); } } for(int i=0;i<4;i++){ for(int j=0;j<4;j++){ if(i==j)continue; for(int k=0;k<4;k++){ if(i==k||j==k)continue; for(int l=0;l<4;l++){ if(i==l||j==l||k==l)continue; System.out.println(list.get(i)+" "+list.get(j)+" "+list.get(k)+" "+list.get(l)); int a=sc.nextInt(); int b=sc.nextInt(); if(a==4&&b==0)return; } } } } } }