409814: GYM103797 A Advisor Enemies

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

Description

A. Advisor Enemiestime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

The team of competitive comedians, comedians++, needs to buy plane tickets to participate in the International Competition of Prehistoric Comedians (ICPC). You might know the founder of the team, the legendary Navarrosaur, who teaches some programming classes. However, the organization that is taking care of issuing the tickets is very well known for its bureaucracy, the Inorganized Management of Education (IME) (Yes, they are so unorganized they've never fixed the spelling mistake). The coordinator of the French arts sector of IME, professor Du'Art, is a very busy person and he asks his advisor, from Netherlands music sector, professor Van Der Som, to take care of the process to buy the flight tickets, but the comedians are having a hard time since the advisor has refused to buy the tickets!

The coordinator wants to help but he cannot interfere in the bureaucracy of IME. He gives the team a list of signatures they must obtain to discuss the advisor's decision and get the authorization to travel. Although, as IME is a very hierarchized institution, the signatures must be obtained in some order, called chain of command. To be more specific, if signature $$$A$$$ precedes signature $$$B$$$, signature $$$B$$$ can only be obtained if you already have signature $$$A$$$.

Given the list by the coordinator, help the comedians to look for a possible way to get all the necessary signatures.

Input

The first line contains one integer, $$$M$$$ ($$$2 \leq M \leq 10^5$$$) — the number of precedence relations.

Each of the next $$$M$$$ lines contain $$$2$$$ strings, $$$A$$$ and $$$B$$$ ($$$1 \leq |A|,|B| \leq 30$$$) — the precedence relations between signatures, meaning "signature $$$A$$$ precedes signature $$$B$$$". $$$A$$$ and $$$B$$$ are different and consist only of uppercase English letters without blank spaces.

Output

If it is possible to get all signatures print "I disagree with the advisor", otherwise print "No more comedians++".

ExamplesInput
2
JEFF POTATO
JEFF MARK
Output
I disagree with the advisor
Input
3
PETER PARKER
PARKER WAYNE
WAYNE PETER
Output
No more comedians++

加入题单

上一题 下一题 算法标签: