#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
int dxx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
int dyy[] = {0, +1, 0, -1, +1, -1, +1, -1};
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
int f[100007], b[100007], cnf[100007], cnb[100007], inf[100007], a[100007];
int main() {
  int n, m, i;
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; i++) {
    scanf("%d", &f[i]);
    cnf[f[i]]++;
    inf[f[i]] = i + 1;
  }
  for (i = 0; i < m; i++) {
    scanf("%d", &b[i]);
    cnb[b[i]]++;
  }
  for (i = 1; i <= n; i++) {
    if (cnb[i] && !cnf[i]) return printf("Impossible\n") & 0;
  }
  for (i = 1; i <= n; i++) {
    if (cnb[i] > 0 && cnf[i] > 1) return printf("Ambiguity\n") & 0;
  }
  for (i = 0; i < m; i++) {
    a[i] = inf[b[i]];
  }
  printf("Possible\n");
  for (i = 0; i < m; i++) printf("%d ", a[i]);
  printf("\n");
  return 0;
}
