#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int mp[100001], b[100001], counter[100001] = {};
  bool Ambiguity[100001] = {};
  for (int i = 1; i <= N; i++) {
    int X;
    cin >> X;
    mp[X] = i;
    if (counter[X]++) Ambiguity[X] = 1;
  }
  for (int i = 1; i <= M; i++) cin >> b[i];
  bool A7a = 0;
  int a[100001];
  for (int i = 1; i <= M; i++) {
    if (counter[b[i]] == 0) {
      cout << "Impossible";
      return 0;
    }
    if (Ambiguity[b[i]]) {
      A7a = 1;
    }
    a[i] = mp[b[i]];
  }
  if (A7a) {
    cout << "Ambiguity";
    return 0;
  }
  cout << "Possible\n";
  for (int i = 1; i <= M; i++) cout << a[i] << " ";
  return 0;
}
