#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int inf = 100000000;
int f[100005];
int b[100005];
int transformm[100005];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int i;
  for (i = 1; i <= n; i++) {
    scanf("%d", &f[i]);
  }
  for (i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
  }
  memset(transformm, -1, sizeof(transformm));
  bool flag1 = 0, flag2 = 0, flag3 = 0;
  for (i = 1; i <= n; i++) {
    if (transformm[f[i]] == -1)
      transformm[f[i]] = i;
    else {
      transformm[f[i]] = inf;
    }
  }
  for (i = 1; i <= m; i++) {
    if (transformm[b[i]] == -1) {
      flag3 = 1;
      break;
    } else if (transformm[b[i]] == inf) {
      flag2 = 1;
    } else {
      b[i] = transformm[b[i]];
    }
  }
  if (flag3 == 1) {
    printf("Impossible\n");
  } else if (flag2 == 1) {
    printf("Ambiguity\n");
  } else {
    printf("Possible\n");
    for (i = 1; i <= m; i++) {
      printf("%d ", b[i]);
    }
    printf("\n");
  }
  return 0;
}
