It’s tough being a teen!

No attempts yetTime limit1sMemory limit128 MB

Problem

There is always a list of things to be done!

Here is a list left for you this morning by your parental figure:

  1. Do your Math homework.
  2. Call your grandma.
  3. Call me at work.
  4. Call your friend.
  5. Feed the dog.
  6. Let the dog out.
  7. Watch television.

(It is nice that your parental figure makes sure you watch television, and not just use the internet all day long.)

Your parental figure has also set constraints on the order of these tasks:

  • Do your Math homework BEFORE you watch television.
  • Do your Math homework BEFORE you call your friend.
  • Call your grandma BEFORE you do your Math homework.
  • Call me at work BEFORE you call your friend.
  • Feed the dog AFTER you call me at work.

Your to-do list above can now be abbreviated as:

1,7
1,4
2,1
3,4
3,5

where x,y means that task number x must be done before task number y.

During the day, your parental figure emails you additional instructions. Write a program that uses your original to-do list together with the additional instructions to output your jobs in an order in which they can be completed. If they cannot all be completed, output that there is no way to complete these tasks and that you are just going to go to bed.

Input

You are given pairs of numbers, one number per line, representing the additional instructions to combine with the original to-do list above. In each pair, the first number x and the second number y mean that task x must be done before task y. The input ends with the pair 0 and 0. There will be at most 10 additional constraints.

Output

Output the tasks on a single line, separated by single spaces, in the order they should be performed. If the tasks cannot all be completed, output exactly:

Cannot complete these tasks. Going to bed.

When several orders are possible, use the following tie-breaking rule: whenever more than one task can be performed next at the same time, the smallest-numbered task must be performed first.