import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); for (int i = 0; i < 1000; i++) { System.out.format("%03d%n",i); if (reader.readLine().equals("unlocked")) { break; } } } }