#include <bits/stdc++.h>
using namespace std;
int n, m;
const int maxn = 1e6;
bool f[maxn], b[maxn];
int a[maxn], c[maxn], d[maxn];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    f[x] = true;
    c[i] = x;
    a[x] = i;
  }
  sort(c, c + n);
  bool Ok = true, Ok1 = false;
  for (int i = 0; i < m; i++) {
    int y;
    scanf("%d", &y);
    d[i] = y;
    if (!f[y]) {
      Ok = false;
    }
    if (upper_bound(c, c + n, y) - lower_bound(c, c + n, y) > 1) {
      Ok1 = true;
    }
  }
  if (!Ok) {
    printf("Impossible");
    return 0;
  } else if (Ok1) {
    printf("Ambiguity");
    return 0;
  } else {
    printf("Possible\n");
    for (int i = 0; i < m; i++) {
      printf("%d ", a[d[i]] + 1);
    }
  }
}
