#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int main() {
  int n, m, ff[100100] = {0}, pf[100100] = {0}, a[100100], b[100100], f[100100];
  scanf("%d", &n);
  scanf("%d", &m);
  n++;
  m++;
  for (int(i) = (1); (i) < (n); ++(i)) {
    scanf("%d", &f[i]);
    ff[f[i]]++;
    pf[f[i]] = i;
  }
  for (int(i) = (1); (i) < (m); ++(i)) {
    scanf("%d", &b[i]);
  }
  int g = 1;
  for (int(i) = (1); (i) < (m); ++(i)) {
    if (ff[b[i]] == 0) {
      printf("Impossible\n");
      return (0);
    } else if (ff[b[i]] > 1) {
      g = 0;
    } else {
      a[i] = pf[b[i]];
    }
  }
  if (g) {
    printf("Possible\n");
    for (int(i) = (1); (i) < (m); ++(i)) {
      printf("%d ", a[i]);
    }
  } else {
    printf("Ambiguity\n");
  }
  return (0);
}
