#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int b[100005], a[100005], F[100005];
int main() {
  int n, m, x;
  cin >> n >> m;
  for (int i = 1; i < (n + 1); i++) {
    scanf("%d", &x);
    F[x]++;
    a[x] = i;
  }
  short q = 0;
  for (int i = 1; i < (m + 1); i++) scanf("%d", &b[i]);
  for (int i = 1; i < (m + 1); i++) {
    if (!F[b[i]]) {
      q = 1;
      break;
    } else if (F[b[i]] > 1) {
      q = 2;
    }
    b[i] = a[b[i]];
  }
  if (q == 1)
    printf("Impossible\n");
  else if (q == 2)
    printf("Ambiguity\n");
  else {
    printf("Possible\n");
    for (int i = 1; i < (m + 1); i++) printf("%d ", b[i]);
  }
  return 0;
}
