#include <bits/stdc++.h>
std::multiset<int> s;
std::unordered_map<int, int> func;
int main() {
  std::vector<int> ans;
  int n, m, x, fai, fi;
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &fi);
    s.insert(fi);
    func[fi] = i;
  }
  int q;
  int am = 0;
  for (int i = 0; i < m; i++) {
    scanf("%d", &fai);
    q = s.count(fai);
    if (q != 0) {
      if (q == 1)
        ans.push_back(func[fai]);
      else {
        am = 1;
      }
    } else {
      printf("Impossible");
      return 0;
    }
  }
  if (am) {
    printf("Ambiguity\n");
    return 0;
  }
  printf("Possible\n");
  for (size_t i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
