#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005], f[100005], cnt[100005], ans[100005];
int main() {
  int i, j, k, l, n, m;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> j;
    if (!cnt[j]) f[j] = i;
    cnt[j]++;
  }
  int flag = 1;
  l = 1;
  for (i = 1; i <= m; i++) {
    cin >> j;
    if (flag)
      if (!cnt[j])
        flag = 0;
      else if (cnt[j] > 1)
        flag = 2;
      else
        ans[l++] = f[j];
  }
  if (l == m + 1) {
    cout << "Possible\n";
    for (i = 1; i <= m; i++) cout << ans[i] << " ";
    cout << endl;
  } else if (!flag)
    cout << "Impossible\n";
  else
    cout << "Ambiguity\n";
  return 0;
}
