#include <bits/stdc++.h>
using namespace std;
int x[100000] = {0}, y[100000] = {0};
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int a[n], b[m], c[m];
  bool t = 0;
  unordered_map<int, int> x;
  set<int> y;
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    if (x.count(a[i])) y.insert(a[i]);
    x[a[i]] = i + 1;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", b + i);
    if (x.count(b[i]) == 0) {
      printf("Impossible");
      return 0;
    } else
      c[i] = x[b[i]];
    if (y.count(b[i])) t = 1;
  }
  if (t)
    printf("Ambiguity");
  else {
    printf("Possible\n");
    for (int i = 0; i < m; i++) printf("%d ", c[i]);
  }
  return 0;
}
