Guess the String

I have a ‘01’ string S whose length is between 1 and 100 (inclusive). Your task is to guess it. Each time you can give me a ‘01’ string and I’ll tell you whether it’s a continuous substring of S. Interaction Protocol Your program should read from standard input, and write to standard output. After printing each line to the standard output, you should flush the output, by calling fflush(stdout) or cout << flush in C/C++, flush(output) in Pascal and System.out.flush() in Java. Please read general instructions for interactive problems for more information. First, read the number of test cases T (1 ≤ T ≤ 100). For each test case, issue one or more ‘Ask’ command, followed by an ‘Answer’ command. Command Description If your program violated any of these rules (bad format, invalid arguments etc), the server will exit immediately, and you will receive Protocol Violation (PV). Protocol Limit For each test case, you can issue at most 222 ‘Ask’ commands, otherwise you’ll get Protocol Limit Exceeded (PLE). Ask t Returns ‘1’ if t is a substring of S, otherwise returns ‘0’. The length of string t should be between 1 and 100 (inclusive). Answer S Tell us your answer. This command does not return anything. Sample Interaction 1 1 1 0 Ask 010 Ask 101 Ask 100 Answer 0101