#include <bits/stdc++.h>
using namespace std;
const double EPS = 1.0 / 1000000000;
const long long mod = 1000000007;
int f[200000], b[200000], a[200000], idx[200000];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    f[x]++;
    idx[x] = i;
  }
  for (int i = 1; i <= m; i++) cin >> b[i];
  int am = 0;
  for (int i = 1; i <= m; i++) {
    if (!f[b[i]]) {
      cout << "Impossible" << endl;
      return 0;
    }
    if (f[b[i]] > 1) {
      am = 1;
    }
    a[i] = idx[b[i]];
  }
  if (am) {
    cout << "Ambiguity" << endl;
    return 0;
  }
  cout << "Possible" << endl;
  for (int i = 1; i <= m; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
