#include <bits/stdc++.h>
using namespace std;
int b[100100];
vector<int> f[100010];
int a[100010];
int n, m;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    f[t].push_back(i + 1);
  }
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
  }
  bool am = false, im = false;
  for (int i = 0; i < m; ++i) {
    if (f[b[i]].size() > 1) {
      am = true;
    }
    if (f[b[i]].size() == 0) {
      im = true;
    }
    if (im) {
      break;
    }
    a[i] = f[b[i]].back();
  }
  if (im) {
    cout << "Impossible" << endl;
    return 0;
  }
  if (am) {
    cout << "Ambiguity" << endl;
    return 0;
  }
  cout << "Possible" << endl;
  for (int i = 0; i < m; ++i) {
    cout << a[i] << " ";
  }
  return 0;
}
