#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000100;
const int INF = (1 << 29);
const double EPS = 1e-13;
const double Pi = acos(-1.0);
int n, m;
long long f[maxn], b[maxn], F[maxn];
long long a[maxn];
int main() {
  while (cin >> n >> m) {
    memset(F, -1, sizeof(F));
    for (int i = 1; i <= n; i++) {
      scanf("%I64d", &f[i]);
      if (F[f[i]] == -1)
        F[f[i]] = i;
      else
        F[f[i]] = -2;
    }
    for (int i = 1; i <= m; i++) scanf("%I64d", &b[i]);
    int flag = 0;
    for (int i = 1; i <= m; i++) {
      if (F[b[i]] == -2) {
        flag = 2;
        break;
      } else
        a[i] = F[b[i]];
    }
    for (int i = 1; i <= m; i++) {
      if (F[b[i]] == -1) {
        flag = -1;
        break;
      } else
        a[i] = F[b[i]];
    }
    if (!flag) {
      puts("Possible");
      for (int i = 1; i <= m; i++) {
        if (i != m)
          printf("%d ", a[i]);
        else
          printf("%d\n", a[i]);
      }
    } else if (flag == 2)
      puts("Ambiguity");
    else
      puts("Impossible");
  }
  return 0;
}
