#include <bits/stdc++.h>
using namespace std;
map<int, int> fp;
map<int, int> id;
int f[100005];
int b[100005];
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    fp.clear();
    id.clear();
    int i;
    for (i = 0; i < n; i++) {
      scanf("%d", &f[i]);
      fp[f[i]]++;
      id[f[i]] = i;
    }
    int sum = 0;
    int tsum = 0;
    for (i = 0; i < m; i++) {
      scanf("%d", &b[i]);
      if (fp[b[i]] == 1)
        sum++;
      else if (fp[b[i]] > 1)
        tsum++;
    }
    if (sum + tsum < m)
      printf("Impossible\n");
    else if (tsum > 0)
      printf("Ambiguity\n");
    else {
      printf("Possible\n");
      int flag = 0;
      for (i = 0; i < m; i++) {
        if (flag == 0) {
          printf("%d", id[b[i]] + 1);
          flag = 1;
        } else if (flag == 1)
          printf(" %d", id[b[i]] + 1);
      }
      printf("\n");
    }
  }
}
