#include <bits/stdc++.h>
using namespace std;
long long f1 = 0, f2 = 0;
long long ans[100100];
long long n, m;
void answer() {
  if (f1 == 1)
    cout << "Ambiguity";
  else if (f2 == 2) {
    cout << "Possible" << endl;
    for (int i = 0; i < m; ++i) cout << ans[i] << " ";
  } else {
    cout << "Impossible";
  }
}
int main() {
  map<long long, long long> amp, mp;
  vector<long long> b;
  long long k = 0;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    long long a;
    cin >> a;
    mp[a] = i;
    amp[a]++;
  }
  for (int i = 0; i < m; ++i) {
    long long a;
    cin >> a;
    b.push_back(a);
  }
  for (int i = 0; i < m; ++i) {
    if (amp[b[i]] == 0) {
      cout << "Impossible";
      return 0;
    }
    if (amp[b[i]] > 1) f1 = 1;
    if (amp[b[i]] == 1) {
      f2 = 2;
      ans[k] = mp[b[i]] + 1;
      k++;
    }
  }
  answer();
  return 0;
}
