URI Online Judge | 2478

Hit the Gift

By Jessica Dagostini, URI Online Judge BR Brazil

Timelimit: 1

In the Natalícia family, the realization of the Secret Santa on the Christmas eve is traditional. Every year the whole family gets together to exchange gifts. It's a time of great fun and relaxation.

This year the youngest member of the family, Jocelina, decided to make the moment even more fun: she proposed that all participants put on a list 3 suggestions for gifts. From this list, she thought in a program that inserted a name N and a gift P, the program returns if the person has hit or not the present for his secret friend.

But Jocelina does not know much of programming, and ended up needing help to make this program. You, being taken by the christmas spirit, accepted the challenge!


The input consists in a several test cases and ends with EOF. The first line contain a number X (3 ≤ X ≤ 20) that represents the number of participants in the Secret Santa. The following X lines contain a name N and 3 options of desired gifts P. After this, the next lines will contain a name N and a gift P that represents the consults made.


Your programm should return if the person hit or not the present, showing "Uhul! Seu amigo secreto vai adorar o/" (Yay! Your secret friend will love it!) if matched, and if not, "Tente Novamente!" (Try Again!);
Input Sample Output Sample


iara mochila estojo lapis

adelar sapato camisa carteira

jessica agenda bolsa brincos

jocelina xicara meias perfume

elaine sandalia sapatilha camiseta

jessica carteira

jessica agenda

iara sandalia

elaine mochila

iara mochila

adelar carteira

Tente Novamente!

Uhul! Seu amigo secreto vai adorar o/

Tente Novamente!

Tente Novamente!

Uhul! Seu amigo secreto vai adorar o/

Uhul! Seu amigo secreto vai adorar o/