#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn], n, m, i, j;
vector<int> pos[maxn];
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    pos[x].push_back(i);
  }
  bool flag = 0;
  for (i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    if (!pos[x].size()) {
      printf("Impossible");
      return 0;
    }
    if (pos[x].size() > 1) {
      flag = 1;
      continue;
    }
    a[i] = pos[x][0];
  }
  if (flag) {
    printf("Ambiguity");
    return 0;
  }
  printf("Possible\n");
  for (i = 1; i <= m; i++) printf("%d ", a[i]);
  return 0;
}
