#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  bool amb = false, possilble = true;
  long long i, j, k, l, x, y;
  long long b[100000 + 10];
  vector<long long> f[n + 10];
  vector<long long> ans[m + 10];
  for (i = 0; i < n + 5; i++) f[i].clear();
  for (i = 1; i <= n; i++) {
    cin >> x;
    f[x].push_back(i);
  }
  for (i = 1; i <= m; i++) cin >> b[i];
  for (i = 1; i <= m; i++) {
    if (f[b[i]].size() == 0) {
      possilble = false;
      break;
    } else {
      if (f[b[i]].size() > 1) {
        amb = true;
      } else
        ans[i].push_back(f[b[i]][0]);
    }
  }
  if (possilble) {
    if (amb)
      cout << "Ambiguity" << endl;
    else {
      cout << "Possible" << endl;
      for (i = 1; i <= m; i++) cout << ans[i][0] << " ";
    }
  } else
    cout << "Impossible" << endl;
  return 0;
}
