#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  bool rep = false;
  int B[m], F[n];
  for (int i = 0; i <= n; i++) F[i] = 0;
  set<int> ambi;
  for (int i = 0; i < n; i++) {
    int f;
    cin >> f;
    if (F[f] != 0) ambi.insert(f);
    F[f] = i + 1;
  }
  int seq[m];
  for (int i = 0; i < m; i++) cin >> B[i];
  for (int i = 0; i < m; i++) {
    if (F[B[i]] == 0) {
      cout << "Impossible";
      return 0;
    }
    if (ambi.find(B[i]) != ambi.end()) rep = true;
    seq[i] = F[B[i]];
  }
  if (rep) {
    cout << "Ambiguity";
    return 0;
  }
  cout << "Possible\n";
  for (int i : seq) cout << i << " ";
}
