#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, a[100000];
struct index_array {
  int index;
  int value;
} f[100000], b[100000];
bool val_comp(index_array x, index_array y) { return x.value < y.value; }
string recover_sequence() {
  sort(f, f + n, val_comp);
  sort(b, b + m, val_comp);
  j = 0;
  string result = "Possible";
  for (i = 0; i < m; ++i) {
    while (b[i].value > f[j].value && j < n) ++j;
    if (j == n || b[i].value != f[j].value) {
      return "Impossible";
    } else {
      if (b[i].value == f[j + 1].value) result = "Ambiguity";
      a[b[i].index] = f[j].index + 1;
    }
  }
  return result;
}
int main() {
  cin >> n;
  cin >> m;
  for (i = 0; i < n; ++i) {
    cin >> f[i].value;
    f[i].index = i;
  }
  for (i = 0; i < m; ++i) {
    cin >> b[i].value;
    b[i].index = i;
  }
  string result = recover_sequence();
  cout << result << "\n";
  if (result == "Possible") {
    for (i = 0; i < m; ++i) cout << a[i] << " ";
  }
  return 0;
}
