using System; namespace No305 { class MainClass { private static long MulValue(int d) { long s = 1L; for(int i =0;i < d;i++) { s *= 10L; } return s; } public static void Main (string[] args) { long output = 0; Console.WriteLine (output.ToString ("D10")); var line = Console.ReadLine (); if (line == "10 unlocked") { return; } var firstMatched = Convert.ToInt32(line.Split (' ')[0]); int[] results = new int[10]; for (int digit = 0; digit < 10; digit++) { long mul = MulValue (digit); long maxValue = 0; int maxCount = firstMatched; for (long i = 1; i < 10; i++) { long f = i * mul; Console.WriteLine (f.ToString ("D10")); var currentLine = Console.ReadLine (); if (currentLine == "10 unlocked") { return; } var currentMatched = Convert.ToInt32(currentLine.Split (' ')[0]); if (currentMatched > firstMatched) { maxValue = i; break; } if (currentMatched < firstMatched) { maxValue = 0; break; } if (currentMatched > maxCount) { maxValue = i; maxCount = currentMatched; } } results [10 - digit] = (int)maxValue; } Console.WriteLine (string.Join (string.Empty, results)); if (Console.ReadLine () != "10 unlocked") { throw new Exception(); } } } }