Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

I. Isolation Intrusion
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Gerrit Dou (1613–1675), Hermit. Oil on panel, 1660.

For your upcoming documentary about The Most Isolated Person in the World, you have narrowed the search down to three candidates, all of them hermits. For each of them, you have found out how many people they have met in the past year. The fewer, the more isolated: the most isolated person in the world is the hermit who has met strictly fewer people than any of the others.

There is a catch. A documentary needs a film crew, and the moment your crew walks up to a hermit's door, that hermit has met all of you as well. Choose the wrong hermit or bring too many people, and by the time the cameras are rolling, your title is no longer true.

So before you book any flights, work out whether the film can be made at all: is there a hermit who is still the most isolated person in the world after your visit?

Input

The input consists of:

  • One line with an integer $$$n$$$ ($$$1 \leq n \leq 10$$$), the size of your film crew, including yourself.
  • Three lines, one per hermit, each with an integer $$$m$$$ ($$$0\leq m\leq 1000$$$), the number of people that hermit has met in the past year.
Output

If you can make the film, output how many people the hermit you visit will have met once your crew has arrived. Otherwise, output "impossible".

Examples
Input
2
4
1
5
Output
3
Input
8
0
10
8
Output
impossible