#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, i, j, ans, F[100009], B[100009], S[100009], a, b;
  while (cin >> n >> m) {
    ans = 0;
    long long int amb = 0;
    long long int imp = 0;
    memset(S, 0, sizeof S);
    for (i = 1; i <= n; i++) {
      cin >> F[i];
      if (S[F[i]] > 0 || S[F[i]] == -1) {
        S[F[i]] = -1;
        continue;
      }
      S[F[i]] = i;
    }
    for (i = 1; i <= m; i++) cin >> B[i];
    for (i = 1; i <= m; i++) {
      a = B[i];
      b = S[a];
      if (b == -1) {
        amb = 1;
        continue;
      }
      if (b < 1 || b > n) imp = 1;
    }
    if (imp == 1)
      cout << "Impossible" << endl;
    else if (amb == 1)
      cout << "Ambiguity" << endl;
    else {
      cout << "Possible" << endl;
      for (i = 1; i < m; i++) {
        a = B[i];
        b = S[a];
        cout << b << " ";
      }
      a = B[i];
      b = S[a];
      cout << b << endl;
    }
  }
  return 0;
}
