SP9690 UQAS - Universal Question Answering System

Description

Every student needs help from getting new knowledge by asking questions. Surveys are suggesting that some similar questions are repeated frequently. So it will be nice to develop an automatic question-answering system to answer these questions. Your algorithm should not have any prior knowledge, but it must be able to read sentences and remember the mentioned facts. Whenever the question is asked about such a fact, the system has to answer it properly.

Input Format

The input consists of many dialogues. There is a single positive integer T on the first line of input, which denotes the number of following dialogues.(T

Output Format

For each test case, output two lines. The first line describes the test case number counting from 1, while the second line contains the same number of characters as the number of questions in this test case. Each character is either **Y**(denoting you can get that fact logically) or **M**(otherwise), without quotes. See the example.