#2029. 梦幻 | Reopening of Dream

梦幻 | Reopening of Dream

题目描述

PION2202 的选手代码公布了。作为一个连续编写了十年迷惑行为大赏的人,你当然是要抢先把代码中的各种事迹发出来啦。

首先关注的肯定是大家的文件输入输出有没写对。你已经让小 E 把每道题的题目名称和每位选手的 freopen 语句整理出来了。

PION2202 一共有 mm 道题,有 nn 位选手参与。你决定把选手分成三类:

  1. 普通人:最正常不过的 freopen 语句;
  2. 见祖宗人:被注释的 freopen 语句;
  3. 乐子人:其他形式的 freopen 语句。

形式化地,普通人的所有题目的 freopen 语句都应该恰好是

freopen(".in","r",stdin);
freopen(".out","w",stdout);

其中的 `` 应替换成对应的题目名称。

见祖宗人的 freopen 语句中存在至少一道题的至少一行语句以 //freopen( 开头,以 ); 结尾。

如果一位选手的 freopen 语句不满足上面两种情况,则称这位选手为乐子人。

你需要判断每位选手是普通人,见祖宗人还是乐子人。

输入格式

第一行一个正整数 TT,表示子任务编号。

第二行两个正整数 n,mn,m,分别表示选手数和题目数。

接下来 mm 行,每行包含一个仅由小写字母构成的字符串,其中第 ii 行表示第 ii 道题目的题目名称。保证题目名称的长度在 11 到 1010 之间。

接下来 n×(2m+1)n\times(2m+1) 行,在每 2m+12m+1 行中,第一行为空行,后 2m2m 行表示一位选手的所有题目的 freopen 语句,按照题目顺序给出。前两行为第一题的 freopen 语句,依次类推,最后两行为最后一题的 freopen 语句。

保证所有的 freopen 语句的每个字符的 ASCII 码均在 3333 到 126126 之间,即不含空格等不可见字符。

保证每一行 freopen 语句的长度在 11 到 100100 之间。

输出格式

输出 nn 行,其中第 ii 行表示第 ii 位选手的分类。

如果是普通人,就要祝他 RP++,所以就输出一行 PION2202 RP++.。

如果是见祖宗人,那就只好输出一行 Wrong file operation takes you to your ancestors along with your 3 years' efforts on OI.。

如果是乐子人,就祝他在玩得开心的同时注意不要弄错了,于是输出一行 Good luck and have fun.。

样例

3
4 4
tnalp
woem
kcarrab
hctam

freopen("tnalp.in","r",stdin);
freopen("tnalp.out","w",stdout);
freopen("woem.in","r",stdin);
freopen("woem.out","w",stdout);
freopen("kcarrab.in","r",stdin);
freopen("kcarrab.out","w",stdout);
freopen("hctam.in","r",stdin);
freopen("hctam.out","w",stdout);

freopen("tnalp.in","r",stdin);
freopen("tnalp.out","w",stdout);
//freopen("woem.in","r",stdin);
freopen("woem.out","w",stdout);
freopen("kcarrab.in","r",stdin);
//I_AK_IOI!!!
freopen("hctam.in","r",stdin);
freopen("hctam.out","w",stdout);

freopen("tnalp.in","r",stdin);
freopen("tnalp.out","w",stdout)
freopen("owem.in","r",stdin);
freopen("woem.out","w",stdout);
freopen("kcarrab.in","r",stdout);
freopen("kcarrab.out","w",stdin);
freopen("hctam.out","w",stdout);
freopen("hctam.in","r",stdin);

freopen("tnalp.in","r",stdin);//I_LOVE_CCF
freopen("tnalp.out","w",stdout);
freopen("woem.in","r",stdin);//I_HATE_THIS
freopen("woem.out","w",stdout);
freopen("kcarrab.in"/*I_FORGET_HOW_TO_FIND_BRIDGES!!!!!!*/,"r",stdin);
freopen("kcarrab.out","w",stdout);
freopen("hctam.in","r",stdin);//I_CAN_GET_ONLY_8PTSqwq
freopen("hctam.out","w",stdout);
PION2202 RP++.
Wrong file operation takes you to your ancestors along with your 3 years' efforts on OI.
Good luck and have fun.
Good luck and have fun.

题目来源:洛谷 P8964