#include <bits/stdc++.h>
using namespace std;
long long ar[100009], f[100009], b[100009], fl = 1;
map<long long, long long> mb, mf;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> f[i];
    mf[f[i]]++;
    ar[f[i]] = i;
  }
  for (long long i = 1; i <= m; i++) {
    cin >> b[i];
    mb[b[i]]++;
  }
  for (auto pp : mb) {
    long long x = pp.first;
    if (mf[x] == 0) {
      cout << "Impossible" << endl;
      return 0;
    }
    if (mf[x] != 1) fl = 0;
  }
  if (!fl)
    cout << "Ambiguity" << endl;
  else {
    cout << "Possible" << endl;
    for (long long i = 1; i <= m; i++) {
      long long x = b[i];
      cout << ar[x] << " ";
    }
    cout << endl;
  }
}
