Please subscribe to the official Codeforces channel in Telegram via the link: https://t.me/codeforces_official.
×

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

B. Spongebob and Joke

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputWhile Patrick was gone shopping, Spongebob decided to play a little trick on his friend. The naughty Sponge browsed through Patrick's personal stuff and found a sequence *a*_{1}, *a*_{2}, ..., *a*_{m} of length *m*, consisting of integers from 1 to *n*, not necessarily distinct. Then he picked some sequence *f*_{1}, *f*_{2}, ..., *f*_{n} of length *n* and for each number *a*_{i} got number *b*_{i} = *f*_{ai}. To finish the prank he erased the initial sequence *a*_{i}.

It's hard to express how sad Patrick was when he returned home from shopping! We will just say that Spongebob immediately got really sorry about what he has done and he is now trying to restore the original sequence. Help him do this or determine that this is impossible.

Input

The first line of the input contains two integers *n* and *m* (1 ≤ *n*, *m* ≤ 100 000) — the lengths of sequences *f*_{i} and *b*_{i} respectively.

The second line contains *n* integers, determining sequence *f*_{1}, *f*_{2}, ..., *f*_{n} (1 ≤ *f*_{i} ≤ *n*).

The last line contains *m* integers, determining sequence *b*_{1}, *b*_{2}, ..., *b*_{m} (1 ≤ *b*_{i} ≤ *n*).

Output

Print "Possible" if there is exactly one sequence *a*_{i}, such that *b*_{i} = *f*_{ai} for all *i* from 1 to *m*. Then print *m* integers *a*_{1}, *a*_{2}, ..., *a*_{m}.

If there are multiple suitable sequences *a*_{i}, print "Ambiguity".

If Spongebob has made a mistake in his calculations and no suitable sequence *a*_{i} exists, print "Impossible".

Examples

Input

3 3

3 2 1

1 2 3

Output

Possible

3 2 1

Input

3 3

1 1 1

1 1 1

Output

Ambiguity

Input

3 3

1 2 1

3 3 3

Output

Impossible

Note

In the first sample 3 is replaced by 1 and vice versa, while 2 never changes. The answer exists and is unique.

In the second sample all numbers are replaced by 1, so it is impossible to unambiguously restore the original sequence.

In the third sample *f*_{i} ≠ 3 for all *i*, so no sequence *a*_{i} transforms into such *b*_{i} and we can say for sure that Spongebob has made a mistake.

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/13/2018 10:33:37 (f2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|