#include <bits/stdc++.h>
using namespace std;
vector<int> f[100001];
int main(int argc, char const *argv[]) {
  int n, m;
  scanf("%d%d", &n, &m);
  int b[m];
  bool dup = false;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    f[x].push_back(i + 1);
  }
  for (int i = 0; i < m; i++) scanf("%d", &b[i]);
  for (int i = 0; i < m; i++) {
    if (!f[b[i]].size()) {
      printf("Impossible\n");
      return 0;
    }
  }
  int a[m];
  for (int i = 0; i < m; i++) {
    if (f[b[i]].size() > 1) {
      printf("Ambiguity\n");
      return 0;
    }
    a[i] = f[b[i]][0];
  }
  printf("Possible\n");
  for (int i = 0; i < m; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
  return 0;
}
