#include <bits/stdc++.h>
using namespace std;
int F[100100], B[100100], A[100100];
struct classcomp {
  bool operator()(const pair<int, int>& lhs, const pair<int, int>& rhs) const {
    return lhs.first < rhs.first;
  }
};
void __main() {
  int n, m;
  cin >> n >> m;
  multimap<int, int> Fpos;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    Fpos.emplace(x, i);
  }
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    B[i] = x;
    int cnt = Fpos.count(x);
    if (cnt == 1) {
      A[i] = Fpos.find(x)->second;
    } else if (cnt == 0) {
      cout << "Impossible" << endl;
      return;
    }
  }
  for (int i = 0; i < m; i++) {
    int cnt = Fpos.count(B[i]);
    if (cnt > 1) {
      cout << "Ambiguity" << endl;
      return;
    }
  }
  cout << "Possible" << endl;
  for (int i = 0; i < m; i++) {
    cout << A[i] + 1 << " ";
  }
}
int main() {
  __main();
  return 0;
}
