Kurfürst of horrors
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Uncle Valentyn works as a watchman at school No. 7. As you know, our authorities use schools as polling stations, so on the night after the elections, Uncle Valentyn got new duties — to guard the election commission and ballots from natural disasters, terrorist acts, and other evil spirits.
Walking through the polling station in the middle of the night, Uncle Valentyn heard a rustling sound from the side of the voting booths. He got very scared and hid in his backroom. A herd of thoughts immediately flashed through his head about what it could be. The most likely thought, in his opinion, turned out to be that a cunning elector, for the purpose of falsifying election results, decided to hide in the voting booth to do his dark deed at night.
Uncle Valentyn immediately remembered the CCTV cameras that our authorities prudently installed at every polling station, and without wasting a minute, he set out to review the entire voting process. To put it briefly, two types of events occurred during the elections: an elector enters a voting booth, or an elector leaves a booth.
Your task is to tell Uncle Valentyn whether the cunning elector remained at the station, or if this is all a fruit of Uncle Valentyn’s vivid imagination.
Input
The first line contains a single positive integer \(n\) — the number of events of entering or
leaving the booth. The next \(n\) lines
contain one word each — In if an elector enters the booth,
and Out if they leave. The events at the station occurred
in this exact order.
Output
Your program should output Cunning elector if at least
one elector remained at the polling station, Just a fantasy
if no one remained, or Error if Uncle Valentyn made a
mistake and the input data is contradictory. We will assume that the
number of booths is sufficient to accommodate an arbitrary number of
electors.
Constraints
\(1 \le n \le 10^3\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 3 In In Out | Cunning elector |
Notes
Two electors entered, but only one left. Therefore, Uncle Valentyn is in for a terrible night alone with the falsifier.
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|