import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int[] arr = new int[10]; int prev = getAns(arr, sc); if (prev == 10) { return; } for (int i = 0; i < 10; i++) { for (int j = 0; j < 9; j++) { arr[i]++; int tmp = getAns(arr, sc); if (tmp == 10) { return; } if (tmp > prev) { prev = tmp; break; } else if (tmp < prev) { arr[i]--; break; } } } } static int getAns(int[] arr, Scanner sc) { StringBuilder sb = new StringBuilder(); for (int x : arr) { sb.append(x); } System.out.println(sb); System.out.flush(); int ans = sc.nextInt(); sc.next(); return ans; } }