DMOPC '15 Contest 5 P2 - D-Mails

View as PDF

Submit solution


Points: 5 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Future Gadget #8 - Phone Microwave (name subject to change) has finally been completed! To test out the Phone Microwave, the members of the Future Gadget Lab decided to send N messages over to another timeline. As the recipient of these messages, you're curious as to who they were from.

You know that each member of the FGL will always send their own tagline as their messages.

  • Lab Member 001: Okabe - elpsycongroo
  • Lab Member 002: Mayuri - tuturu
  • Lab Member 003: Daru - superhacker
  • Lab Member 004: Kurisu - myfork

Unfortunately, the Phone Microwave doesn't seem to be fully functional yet, so the messages are often altered when travelling to the other timeline. While the order of characters in the original message will not change, extra characters may be inserted here and there. In addition, it is possible that multiple members have contributed to the message, therefore a single message may contain more than one member's tagline. If the message does not contain any of the taglines, it must have been tampered with by someone from SERN, in which case you should output SERN spy!. Otherwise, for each of the N messages, you would like to know who it was from.

Input Specification

The first line of input will contain N, the number of messages. (1 \le N \le 100)

The next N lines will each contain a message composed of only lowercase Latin letters. Each message will be no longer than 100 characters.

Output Specification

For each message, output the name of the sender on a separate line.

In the case that the message could have been from multiple senders, you should output the names of all the possible senders in order of their seniority in the FGL (i.e. Okabe > Mayuri > Daru > Kurisu) and separate their names with or.

If the sender cannot be identified, output SERN spy!.

Sample Input

4
tututututuru
shovelpsycongeeroom
familysupermarketforhackers
forkmyhackertutus

Sample Output

Mayuri
Okabe
Daru or Kurisu
SERN spy!

Comments


  • 0
    InfinityAtEnd  commented on July 30, 2022, 8:02 a.m.

    I don't get it where I screw up .... my code outputs the corect sample for the one stated above but when I submit the code I don't get anything right..can someone take a look and help me out a bit here ?!

    Thanks a lot !!!


  • 0
    fafalnq  commented on Feb. 9, 2016, 9:45 p.m.

    Is this question somehow relate Steins;Gate ?