#include <bits/stdc++.h>
int numf[200000];
int b[200000];
int lastf[200000];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int t;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &t);
    numf[t] += 1;
    lastf[t] = i + 1;
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d", &t);
    b[i] = t;
  }
  for (int i = 0; i < m; ++i) {
    if (numf[b[i]] == 0) {
      printf("Impossible\n");
      return 0;
    }
  }
  for (int i = 0; i < m; ++i) {
    if (numf[b[i]] != 1) {
      printf("Ambiguity\n");
      return 0;
    }
  }
  printf("Possible\n");
  printf("%d", lastf[b[0]]);
  for (int i = 1; i < m; ++i) {
    printf(" %d", lastf[b[i]]);
  }
  printf("\n");
  return 0;
}
