#include <bits/stdc++.h>
using namespace std;
int a[100500], b[100500], c[100500], f[100500], num[100500];
int main() {
  int i, j, n, m, mark = 0;
  scanf("%d%d", &n, &m);
  for (i = 0; i < 100500; i++) {
    a[i] = 0;
    b[i] = 0;
    c[i] = 0;
    f[i] = 0;
    num[i] = 0;
  }
  for (i = 1; i <= n; i++) {
    scanf("%d", &f[i]);
    num[f[i]]++;
    c[f[i]] = i;
  }
  for (i = 1; i <= m; i++) scanf("%d", &b[i]);
  for (i = 1; i <= m; i++) {
    if (num[b[i]] == 0) {
      mark = 1;
      break;
    } else if (num[b[i]] >= 2)
      mark = 2;
    else {
      a[i] = c[b[i]];
    }
  }
  if (mark == 1)
    printf("Impossible\n");
  else if (mark == 2)
    printf("Ambiguity\n");
  else {
    printf("Possible\n");
    for (i = 1; i <= m; i++) {
      printf("%d", a[i]);
      if (i != m)
        printf(" ");
      else
        printf("\n");
    }
  }
  return 0;
}
