#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  ios::sync_with_stdio(false);
  map<int, int> s;
  int n, m;
  cin >> n >> m;
  int a[n], b[m];
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  for (int i = 0; i < (int)(m); i++) cin >> b[i];
  for (int i = 0; i < (int)(n); i++) {
    if (s[a[i]] == 0)
      s[a[i]] = i + 1;
    else
      s[a[i]] = -1;
  }
  for (int i = 0; i < (int)(m); i++) {
    if (s[b[i]] == 0) {
      cout << "Impossible" << endl;
      return 0;
    }
  }
  for (int i = 0; i < (int)(m); i++) {
    if (s[b[i]] == -1) {
      cout << "Ambiguity" << endl;
      return 0;
    }
  }
  cout << "Possible" << endl;
  for (int i = 0; i < (int)(m); i++) cout << s[b[i]] << " ";
  return 0;
}
