#include <bits/stdc++.h>
using namespace std;
int n, m;
map<int, int> f;
map<int, int> fc;
map<int, int> b;
int bval[100001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int c;
    cin >> c;
    if (fc.find(c) == fc.end()) {
      fc[c] = 1;
      f[c] = i + 1;
    } else {
      fc[c]++;
    }
  }
  for (int j = 0; j < m; j++) cin >> b[j];
  for (int j = 0; j < m; j++) {
    if (f.find(b[j]) == f.end()) {
      printf("Impossible\n");
      return 0;
    }
  }
  for (int j = 0; j < m; j++) {
    if (fc[b[j]] > 1) {
      printf("Ambiguity\n");
      return 0;
    }
  }
  printf("Possible\n");
  for (int j = 0; j < m; j++) {
    printf("%d ", f[b[j]]);
  }
  return 0;
}
