#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100003] = {0}, b[100003], c[100003], d[100003], n, m, i, k;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> d[i];
    a[d[i]]++;
    b[d[i]] = i;
  }
  for (i = 1; i <= m; i++) {
    cin >> c[i];
  }
  for (i = 1; i <= m; i++) {
    if (a[c[i]] == 0) {
      cout << "Impossible";
      return 0;
    }
  }
  for (i = 1; i <= m; i++) {
    if (a[c[i]] > 1) {
      cout << "Ambiguity";
      return 0;
    }
  }
  cout << "Possible"
       << "\n";
  for (i = 1; i <= m; i++) cout << b[c[i]] << " ";
  return 0;
}
