#include <bits/stdc++.h>
using namespace std;
int v[100100];
int f[100100];
int a[100100];
int b[100100];
int in[100100];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> f[i];
    v[f[i]]++;
    in[f[i]] = i;
  }
  for (int i = 1; i <= m; i++) cin >> b[i];
  int t;
  bool z = 0;
  for (int i = 1; i <= m; i++) {
    t = in[b[i]];
    if (v[f[t]] > 1) z = 1;
    if (t == 0) {
      cout << "Impossible";
      exit(0);
    }
    a[i] = t;
  }
  if (z) {
    cout << "Ambiguity";
    exit(0);
  }
  cout << "Possible" << endl;
  for (int i = 1; i <= m; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
