#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int f[100001];
  int b[100001];
  bool amb[100001];
  for (int i = 1; i <= n; i++) {
    f[i] = 0;
    amb[i] = false;
  }
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (f[x] != 0) amb[x] = true;
    f[x] = i + 1;
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  vector<int> a;
  bool am = false;
  bool im = false;
  for (int i = 0; i < m; i++) {
    if (amb[b[i]]) am = true;
    if (f[b[i]] == 0) im = true;
    a.push_back(f[b[i]]);
  }
  if (im) {
    cout << "Impossible";
    return 0;
  }
  if (am) {
    cout << "Ambiguity";
    return 0;
  }
  cout << "Possible\n";
  for (int i = 0; i < m; i++) cout << a[i] << " ";
  return 0;
}
