#include <bits/stdc++.h>
using namespace std;
int a[200000], b[200000], c[200000], v[200000];
int main() {
  int n, m, i, pos;
  while (scanf("%d %d", &n, &m) != EOF) {
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    memset(c, 0, sizeof(c));
    memset(v, 0, sizeof(v));
    for (i = 1; i <= n; i++) {
      scanf("%d", &pos);
      if (!a[pos])
        a[pos] = i;
      else
        v[pos] = 1;
    }
    for (i = 1; i <= m; i++) scanf("%d", &b[i]);
    int f, g;
    f = g = 0;
    for (i = 1; i <= m; i++) {
      if (a[b[i]] && !v[b[i]])
        c[i] = a[b[i]];
      else if (!a[b[i]])
        f = 1;
      else
        g = 1;
    }
    if (f)
      printf("Impossible\n");
    else if (g)
      printf("Ambiguity\n");
    else {
      printf("Possible\n");
      for (i = 1; i <= m; i++) printf("%d%c", c[i], i == m ? '\n' : ' ');
    }
  }
  return 0;
}
