409215: GYM103462 G Guess Strings

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Guess Stringstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

This is an interactive problem. You have to use a flush operation right after printing each line. For example, in C++ you should use the function fflush(stdout), in Java — System.out.flush(), in Pascal — flush(output) and in Python — sys.stdout.flush().

One day, Kwords was very boring, so he constructed a string. This string consists of two types of lowercase letters. And the length of this string is between $$$2$$$ and $$$100$$$.

At the same time, Hsueh- is also boring. So Kwords wants Hsueh- to guess what the string constructed by Kwords is.

Hsueh- can ask kwords for information about the string by inquiry.

In each inquiry, Hsueh- can ask whether a string $$$S$$$ is a substring of string $$$T$$$ which constructed by Kwords is。

In order to respect Hsueh-, Kwords only allows him to ask questions up to $$$200$$$ times.

Interaction

For each output, you must follow the following format.

  • ASK $$$T$$$:The meaning of this format is to ask whether the string $$$T$$$ is a substring of the string S which constructed by Kwords, if it is, the jury will return $$$1$$$, otherwise it will return $$$0$$$.
  • ANSWER $$$T$$$:Make sure your answer is $$$T$$$.
ExampleInput

1

0

1

1

0

0

0

0

Output
ASK a

ASK c

ASK b

ASK ab

ASK aba

ASK abb

ASK aab

ASK bab

ANSWER ab

加入题单

算法标签: