#include <bits/stdc++.h>
using namespace std;
template <typename T>
string NumberToString(T Number) {
  ostringstream ss;
  ss << Number;
  return ss.str();
}
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int ar1[n];
  long long int ar2[m];
  long long int a[m];
  memset(a, -1, sizeof(a));
  long long int ind[100009];
  long long int count[100009];
  memset(ind, 0, sizeof(ind));
  memset(count, 0, sizeof(count));
  for (long long int i = 0; i < n; i++) {
    cin >> ar1[i];
    count[ar1[i]]++;
    ind[ar1[i]] = i;
  }
  long long int possible = 0;
  for (long long int i = 0; i < m; i++) {
    cin >> ar2[i];
    if (count[ar2[i]] == 0) {
      possible = 1;
    }
    if (count[ar2[i]] > 1) {
      if (possible == 0) possible = 2;
    } else {
      if (a[i] == -1)
        a[i] = ind[ar2[i]] + 1;
      else
        possible = 2;
    }
  }
  if (possible == 0) {
    cout << "Possible" << endl;
    for (long long int i = 0; i < m; i++) {
      cout << a[i] << " ";
    }
    cout << endl;
  } else if (possible == 2) {
    cout << "Ambiguity" << endl;
  } else {
    cout << "Impossible" << endl;
  }
}
