import java.util.*; import java.io.*; public class Exercise47{ public static void main (String[] args) throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String nums = "0000000000"; String[] numArray = nums.split(""); a: for (int a = 0; a < 10; a++){ b: for (int b = 0; b < 10; b++){ System.out.println(nums); String result = new String(in.readLine()); int resultBeforeNum = getAnswer(result); if (resultBeforeNum == 10){ break a; } int currentNum = Integer.parseInt(numArray[a]); int changedNum = currentNum + 1; System.out.println(changedNum); numArray[a] = String.valueOf(changedNum); System.out.println(numArray[a]); nums = ""; for (int n = 0; n < 10; n++){ nums += numArray[n]; } System.out.println(nums); result = new String(in.readLine()); int resultAfterNum = getAnswer(result); if (resultAfterNum == 10){ break a; }else if (resultAfterNum > resultBeforeNum){ break b; }else if (resultAfterNum < resultBeforeNum){ numArray[a] = String.valueOf(currentNum); break b; } } } } public static int getAnswer(String result){ String[] resultArray = result.split(" "); int resultNum = Integer.parseInt(resultArray[0]); return resultNum; } }