#include <bits/stdc++.h>
using namespace std;
int pow(int a, int n) {
  int p = 1;
  while (n) n % 2 ? p *= a : n, a *= a, n /= 2;
  return p;
}
int pow_mod(int a, int n, int mod) {
  int p = 1;
  while (n) n % 2 ? p = p * a % mod : n, a = a * a % mod, n /= 2;
  return p;
}
const int mx = 100001;
int a[mx];
int b[mx];
int c[mx], k, ac, im;
int main() {
  int n, m, x;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a[x] = i + 1;
    b[x]++;
  }
  for (int i = 0; i < m; i++) {
    cin >> x;
    if (a[x]) {
      c[k++] = a[x];
    }
    if (b[x] > 1) ac++;
    if (!b[x]) im++;
  }
  if (im) {
    cout << "Impossible";
    return 0;
  }
  if (ac) {
    cout << "Ambiguity";
    return 0;
  }
  cout << "Possible\n";
  for (int i = 0; i < k; i++) {
    cout << c[i] << " ";
  }
}
