#include <bits/stdc++.h>
using namespace std;
struct node {
  int num, Id;
} f[100050];
int n, m, f1[100050], b[100050], a[100050];
int cmp(node p, node q) { return p.num < q.num; }
int Search(int num) {
  int L = 0, R = n;
  while (L <= R) {
    int Mid = (L + R) / 2;
    if (f[Mid].num == num) return f[Mid].Id;
    if (f[Mid].num > num)
      R = Mid - 1;
    else
      L = Mid + 1;
  }
  return -1;
}
int main() {
  while (scanf("%d %d", &n, &m) != EOF) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &f[i].num);
      f[i].Id = i + 1;
      f1[i] = f[i].num;
    }
    sort(f1, f1 + n);
    sort(f, f + n, cmp);
    int flag = 0;
    for (int i = 0; i < m; i++) {
      scanf("%d", &b[i]);
      if (flag == 2) continue;
      int L = lower_bound(f1, f1 + n, b[i]) - f1;
      int H = upper_bound(f1, f1 + n, b[i]) - f1;
      int ans = Search(b[i]);
      if (ans == -1)
        flag = 2;
      else if (L + 1 != H)
        flag = 1;
      else
        a[i] = ans;
    }
    if (flag == 1)
      puts("Ambiguity");
    else if (flag == 2)
      puts("Impossible");
    else {
      puts("Possible");
      for (int i = 0; i < m; i++) printf("%d%c", a[i], i == m - 1 ? '\n' : ' ');
    }
  }
  return 0;
}
