#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
vector<int> pos[100000 + 7];
void reset() {
  int i;
  for (i = 0; i <= 100000; i++) {
    pos[i].clear();
  }
}
int main() {
  int n, m, b[100000 + 7], arr[100000 + 7], f, sz, tmp, i, j, k;
  bool ambi;
  while (scanf("%d %d", &n, &m) == 2) {
    reset();
    ambi = 0;
    for (i = 1; i <= n; i++) {
      scanf("%d", &f);
      pos[f].push_back(i);
    }
    for (i = 1; i <= m; i++) {
      scanf("%d", &b[i]);
    }
    for (i = 1; i <= m; i++) {
      tmp = b[i];
      sz = pos[tmp].size();
      if (sz == 0) {
        break;
      } else if (sz > 1) {
        ambi = 1;
        pos[tmp].pop_back();
      } else {
        arr[i] = pos[tmp][0];
      }
    }
    if (i <= m) {
      printf("Impossible\n");
    } else if (ambi) {
      printf("Ambiguity\n");
    } else {
      printf("Possible\n");
      for (i = 1; i < m; i++) {
        printf("%d ", arr[i]);
      }
      printf("%d\n", arr[i]);
    }
  }
  return 0;
}
