#include <bits/stdc++.h>
using namespace std;
long long ff[1000000];
long long bb[1000000];
map<long long, vector<long long> > mmmf;
map<long long, vector<long long> > mmms;
signed main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= n; ++i) {
    cin >> ff[i];
    mmmf[ff[i]].push_back(i);
  }
  for (long long i = 1; i <= m; ++i) {
    cin >> bb[i];
    mmms[bb[i]].push_back(i);
  }
  long long p = 0;
  for (auto it : mmmf) {
    if (it.second.size() > 1 && mmms.count(it.first)) {
      p = 1;
    }
  }
  for (auto it : mmms) {
    if (!mmmf.count(it.first)) {
      return 0 * printf("Impossible");
    }
  }
  if (p) {
    return 0 * printf("Ambiguity");
  }
  cout << "Possible" << endl;
  for (long long i = 1; i <= m; ++i) {
    cout << mmmf[bb[i]][0] << ' ';
  }
}
