#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005], has[100005], f[100005], freq[100005];
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, i;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> f[i];
    freq[f[i]]++;
    has[f[i]] = i;
  }
  for (i = 1; i <= m; i++) cin >> b[i];
  int flag = 1;
  for (i = 1; i <= m; i++) {
    if (freq[b[i]] == 0) {
      flag = 3;
      break;
    }
    if (freq[b[i]] > 1) {
      flag = 2;
    }
    a[i] = has[b[i]];
  }
  if (flag == 3)
    cout << "Impossible\n";
  else if (flag == 2)
    cout << "Ambiguity\n";
  else {
    cout << "Possible\n";
    for (i = 1; i <= m; i++) cout << a[i] << " ";
    cout << endl;
  }
  return 0;
}
