#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  int a[100010], b[100010];
  int a2[100010] = {0}, a3[100010] = {0}, b2[100010] = {0};
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a2[a[i]]++;
    a3[a[i]] = i + 1;
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
    b2[b[i]]++;
  }
  int test = 1;
  for (int i = 0; i < 100010; i++) {
    if (a2[i] != b2[i] && a2[i] == 0 && b2[i] != 0) {
      test = 3;
      break;
    }
  }
  if (test != 3)
    for (int i = 0; i < 100010; i++) {
      if (b2[i] != 0 && a2[i] != 1) {
        test = 2;
        break;
      }
    }
  if (test == 1) {
    cout << "Possible\n";
    for (int i = 0; i < m; i++) {
      cout << a3[b[i]];
      if (i != m - 1) cout << " ";
    }
    cout << "\n";
  } else if (test == 2) {
    cout << "Ambiguity\n";
  } else if (test == 3) {
    cout << "Impossible\n";
  }
  return 0;
}
