import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int a[]=new int[10],m,t1,t2=0,j; String s=new String(); for(int i=0;i<10;++i){ m=0; for(j=0;j<10;++j){ a[i]=j; for(int k=0;k<10;++k)System.out.print(a[k]); System.out.println(); System.out.flush(); t1=sc.nextInt(); s=sc.next(); if(t1>9)break; if(t1>m){ m=t1; t2=j; } } if(10>j)break; a[i]=t2; } sc.close(); } }