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++) { String s0 = key.toString(); 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(); t = scan.next(); if(t.equals("unlocked")) { System.exit(0); } if(k > X) { key = new StringBuilder(s); break; }else if(k < X) { key = new StringBuilder(s0); break; } } } scan.close(); } }