#include <bits/stdc++.h>
using namespace std;
long long int modpow(long long int a, long long int n, long long int temp) {
  long long int res = 1, y = a;
  while (n > 0) {
    if (n & 1) res = (res * y) % temp;
    y = (y * y) % temp;
    n /= 2;
  }
  return res % temp;
}
long long int f[1000006];
long long int cf[1000006];
long long int cb[1000006];
long long int ans[1000006];
int main() {
  long long int i, j, m, n, t, k, a;
  scanf("%lld", &n);
  scanf("%lld", &m);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a);
    cf[a] = i;
    f[a]++;
  }
  for (i = 1; i <= m; i++) {
    scanf("%lld", &a);
    cb[i] = a;
  }
  long long int fl = 0;
  for (i = 1; i <= m; i++) {
    if (f[cb[i]] == 0) {
      fl = 2;
      break;
    }
  }
  if (fl == 0) {
    for (i = 1; i <= m; i++) {
      if (f[cb[i]] == 1) {
        ans[i] = cf[cb[i]];
      }
      if (f[cb[i]] > 1) {
        fl = 1;
        break;
      }
    }
  }
  if (fl == 0) {
    cout << "Possible" << endl;
    for (i = 1; i <= m; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  } else if (fl == 1) {
    cout << "Ambiguity" << endl;
  } else {
    cout << "Impossible" << endl;
  }
  return 0;
}
