#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> f(n + 1, -1);
  vector<int> a(m);
  bool ambigity = false;
  for (int i = 1; i <= n; ++i) {
    int fi;
    cin >> fi;
    if (f[fi] != -1) {
      f[fi] = -2;
    } else {
      f[fi] = i;
    }
  }
  for (int i = 0; i < m; ++i) {
    int b;
    cin >> b;
    a[i] = f[b];
    if (f[b] == -1) {
      cout << "Impossible" << endl;
      return 0;
    }
    if (f[b] == -2) {
      ambigity = true;
    }
  }
  if (ambigity) {
    cout << "Ambiguity" << endl;
    return 0;
  }
  cout << "Possible" << endl;
  for (int i = 0; i < m; ++i) {
    cout << a[i] << " ";
  }
  cout << endl;
}
