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