import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader buff = new BufferedReader(new InputStreamReader(System.in)); try { for (int i = 0; i < 10; ++i) { for (int j = 0; j < 10; ++j) { for (int k = 0; k < 10; ++k) { System.out.println("" + i + j + k); if ((buff.readLine()).equals("unlocked")) { break; } } } } } catch (NumberFormatException e) { e.getStackTrace(); } catch (IOException e) { e.getStackTrace(); } catch (Exception e) { e.getStackTrace(); } } }