#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> f(n);
  vector<int> a(m);
  vector<int> b(m);
  vector<int> x(n + 1);
  vector<bool> am(n + 1);
  fill(x.begin(), x.end(), -1);
  for (int i = 0; i < n; i++) {
    cin >> f[i];
    if (x[f[i]] == -1) {
      x[f[i]] = i + 1;
    } else {
      am[f[i]] = true;
    }
  }
  bool tam = false;
  for (int i = 0; i < m; i++) {
    cin >> b[i];
    if (x[b[i]] == -1) {
      cout << "Impossible";
      return 0;
    } else if (am[b[i]]) {
      tam = true;
    } else {
      a[i] = x[b[i]];
    }
  }
  if (tam)
    cout << "Ambiguity";
  else {
    cout << "Possible" << endl;
    for (int i = 0; i < m; i++) cout << a[i] << ' ';
  }
  return 0;
}
