当派大星去购物时,海绵宝宝决定对他的朋友玩一个恶作剧。顽皮的海绵宝宝浏览了派大星的个人物品,找到了一个长度为m的序列a1,a2,...,am,由1到n的整数组成,不一定是每个不同的。然后他挑选了一些长度为n的序列f1,f2,...,fn,对于每个数字ai都得到了数字bi=f[ai]。为了完成这个恶作剧,他抹去了最初的序列ai
当派大星买完东西回到家时,很难表达他有多伤心! 我们只想说,海绵宝宝立即对他所做的事情感到非常抱歉,他现在正试图恢复原来的序列。帮助他做到这一点或确定这是不可能的。
While 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 a1,a2,...,am of length m, consisting of integers from 1 to n, not necessarily distinct. Then he picked some sequence f1,f2,...,fn of length n and for each number ai got number bi=fai. To finish the prank he erased the initial sequence ai.
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.
Output
Print "Possible" if there is exactly one sequence ai, such that bi=fai for all i from 1 to m. Then print m integers a1,a2,...,am.
If there are multiple suitable sequences ai, print "Ambiguity".
If Spongebob has made a mistake in his calculations and no suitable sequence ai exists, print "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
fi≠3 for all
i, so no sequence
ai transforms into such
bi and we can say for sure that Spongebob has made a mistake.