Stupendous Man

Time limit1sMemory limit128 MB

Problem

Things were grim at Calvin's house. With his parents out for the night, the nefarious Babysitter Girl had swooped in and taken over with her oppressive regime of evil and terror. But unfortunately for the Babysitter Girl, she did not know that the house was also home to the greatest superhero the world has ever seen. Up in his room, the mild-mannered Calvin leapt into his closet and emerged as... STUPENDOUS MAN! Champion of Liberty! Foe of Tyranny! With his muscles of magnitude and heroic resolve, Stupendous Man bravely ran downstairs, fought the evil Rosalyn, and escaped out the door into the night. With the Babysitter Girl chasing after him, Stupendous Man had only one option: he must shake her off before sneaking back into the house. If he gets caught, Calvin will be in trouble when his parents come home.

Stupendous Man runs across the lawn in a swirling, twisting, winding loop, as fast as he can, to try to lose the Babysitter Girl. His tremendous speed (KAPWINGGG!) means she can only spot him where his path crosses over itself. To try to catch him, she writes down and assigns a number to each self-crossing, in the order Stupendous Man passes through it (see Figure 7). Sometimes she makes a mistake, and that is when Calv... — er, Stupendous Man — escapes her grasp! If the numbers Rosalyn wrote down cannot possibly form a single closed loop, then she is completely confused, has no idea where Calvin is, and must give up the chase.

Figure 7: Stupendous Man's trajectory and the three crossings where the Babysitter Girl can see him.

Input

The input consists of several test cases. Each test case begins with a line containing a single positive integer $N$ ($1 \le N \le 10$). The next line contains a sequence of $2N$ integers that Rosalyn wrote down while watching Stupendous Man's trajectory. The integers are separated by single spaces, and each number from $1$ to $N$ is guaranteed to appear exactly twice in the sequence. Note that the numbers do not necessarily first appear in ascending order! The input ends with a line containing a single $0$, which is not part of any test case.

Output

For each test case, print a single line containing the word escaped if Stupendous Man successfully confuses the Babysitter Girl and gets away, or caught if she manages to untangle his path and find him. Stupendous Man escapes if and only if Rosalyn's sequence of labels cannot form a single closed loop.