#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long modx = 998244353;
const long long Nx = 1e5 + 2;
const long long inf = (long long)(1e19 + 10LL);
void solve() {
  long long n, m;
  cin >> n;
  cin >> m;
  vector<long long> f(n + 1), b(m + 1), a(m + 1);
  unordered_map<long long, long long> first, B, pos;
  set<long long> sta, stb;
  for (long long i = 1; i <= n; i++) {
    cin >> f[i];
    first[f[i]]++;
    pos[f[i]] = i;
  }
  for (long long i = 1; i <= m; i++) {
    cin >> b[i];
  }
  for (long long i = 1; i <= m; i++) {
    if (first[b[i]] == 0) {
      cout << "Impossible" << endl;
      return;
    }
  }
  for (long long i = 1; i <= m; i++) {
    if (first[b[i]] > 1) {
      cout << "Ambiguity" << endl;
      return;
    }
  }
  cout << "Possible" << endl;
  for (long long i = 1; i <= m; i++) {
    cout << pos[b[i]] << " ";
  }
}
signed main() {
  long long test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
