The premier of the anticipated action film
No Thyme to Fry is right around the corner, and
it is time to give early screenings to film critics so that
they can review it. A small cinema has been selected to show
these early screenings.
There are critics
numbered from to
scheduled to watch the
movie early, and each of them will watch it separately. After
watching it, they will immediately give it a score from
to . Susan, the cinema owner, has
carefully looked at every critic’s social media and already
knows that the th
critic thinks the movie is worth a score of . However, the th critic will not simply give the
movie a score of
like you would expect, because they also take into account the
scores that the other critics gave. Here is how they
behave:
-
The first critic to arrive will be so happy that they
are the first to review the movie that they will give it a
score of
regardless of their initial opinion.
-
Every subsequent critic will look at the average score
given by the previous critics. If this number is smaller
than or equal to the initial opinion then the critic will give
it a score of ,
otherwise they will give it a .
Susan thinks the critics’ behaviour is ridiculous. She has
watched the movie, and it is clearly worth a score of exactly
and nothing else!
But Susan is the owner of the cinema, so she gets to decide in
what order to invite the critics. Your task is to find a
permutation of so that if the critics arrive in this order the
average score will be exactly .
Input
The first line of input contains three integers , and (, , ). The second
line contains the
integers ( for each ),
the critic scores as
described above.
Output
If the critics can be ordered in such a way that the
resulting average score is exactly , then output integers (), where
indicates that the
th critic to visit the
cinema is the critic numbered . This list of integers should be a permutation such
that the average score given by the critics is . If there are multiple solutions
any one will be accepted.
Otherwise, if there is no such way to order the critics,
output “impossible”.
Sample Input 1 |
Sample Output 1 |
5 10 30
10 5 3 1 3
|
3 5 2 1 4
|
Sample Input 2 |
Sample Output 2 |
5 5 20
5 3 3 3 3
|
impossible
|