import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); StringBuilder key = new StringBuilder("0000000000"); System.out.println(key.toString()); int X = scan.nextInt(); String t = scan.next(); if(t.equals("unlocked")) { System.exit(0); } for(int i = 0; i < 10; i++) { for(int j = 1; j < 10; j++) { String s = key.replace(i, i + 1, Integer.toString(j)).toString(); System.out.println(s); int k = scan.nextInt(); if(k > X) { key = new StringBuilder(s); break; }else if(k < X) { break; } } } scan.close(); System.out.println(key.toString()); } }