#include <bits/stdc++.h>
using namespace std;
int b[100010], f[100010], ji[100010], lll[100010];
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  int mmm = 0, nnn = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> f[i];
    ji[f[i]]++;
    lll[f[i]] = i;
  }
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    if (mmm == -1)
      continue;
    else {
      if (ji[b[i]] > 1)
        mmm = 1;
      else if (!ji[b[i]])
        mmm = -1;
    }
  }
  if (mmm == -1)
    cout << "Impossible" << endl;
  else if (mmm == 1)
    cout << "Ambiguity" << endl;
  else {
    cout << "Possible" << endl;
    for (int i = 1; i < m; i++) cout << lll[b[i]] << " ";
    cout << lll[b[m]] << endl;
  }
  return 0;
}
