#include <bits/stdc++.h>
using namespace std;
int i, n, m, f[10000000], b[1000000], chck[1000000], z, indx[100005];
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> b[i];
    chck[b[i]]++;
    indx[b[i]] = i;
  }
  for (i = 1; i <= m; i++) {
    cin >> f[i];
    if (chck[f[i]] == 0) {
      cout << "Impossible";
      return 0;
    }
    if (chck[f[i]] > 1) {
      z = 1;
    }
  }
  if (z == 1) {
    cout << "Ambiguity";
    return 0;
  }
  cout << "Possible" << endl;
  for (i = 1; i <= m; i++) cout << indx[f[i]] << " ";
}
