#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  int f[n], b[m], a[m];
  map<int, int> x;
  for (int i = 0; i < n; i++) {
    scanf("%d", &f[i]);
    if (x.find(f[i]) != x.end())
      x[f[i]] = -1;
    else
      x[f[i]] = i;
  }
  for (int i = 0; i < m; i++) scanf("%d", &b[i]);
  sort(f, f + n);
  bool y = 0, z = 0;
  for (int i = 0; i < m; i++) {
    if (x.find(b[i]) != x.end()) {
      if (x[b[i]] == -1) {
        z = 1;
      } else {
        a[i] = x[b[i]];
      }
    } else {
      printf("Impossible");
      y = 1;
      break;
    }
  }
  if (!y) {
    if (z) {
      printf("Ambiguity");
    } else {
      printf("Possible\n");
      for (int i = 0; i < m; i++) {
        printf("%d", a[i] + 1);
        printf(" ");
      }
    }
  }
}
