#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const int MAX = (int)1e5 + 5;
int main(void) {
  ios_base::sync_with_stdio(false);
  int m, n;
  while (cin >> n >> m) {
    vector<pair<int, int> > f;
    map<int, int> mpf, mpb;
    for (int i = 0; i < n; i++) {
      int ff;
      cin >> ff;
      f.push_back(make_pair(ff, i));
      mpf[ff]++;
    }
    sort(f.begin(), f.end());
    vector<int> b(m);
    for (int i = 0; i < m; i++) {
      cin >> b[i];
      mpb[b[i]]++;
    }
    int amb = 0;
    for (auto it = mpb.begin(); it != mpb.end(); it++) {
      int cur = it->first;
      if (!mpf[cur]) {
        cout << "Impossible\n";
        return 0;
      }
      if (mpf[cur] > 1) amb = 1;
    }
    if (amb) {
      cout << "Ambiguity\n";
      continue;
    }
    vector<int> a(m);
    for (int i = 0; i < m; i++) {
      auto it = lower_bound(f.begin(), f.end(), make_pair(b[i], -1));
      int idx = it - f.begin();
      a[i] = f[idx].second + 1;
    }
    cout << "Possible\n";
    for (int i = 0; i < m; i++) cout << a[i] << " ";
    cout << "\n";
  }
  return 0;
}
