#include <bits/stdc++.h>
using namespace std;
const int MAXn = 1000 * 100;
vector<int> f[MAXn + 2], arr[MAXn + 2];
int main() {
  int n, m, a;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    f[a].push_back(i);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &a);
    for (int j = 0; j < (int)f[a].size(); j++) arr[i].push_back(f[a][j]);
  }
  int Max = 0, Min = INT_MAX;
  for (int i = 0; i < m; i++) {
    Max = max(Max, (int)arr[i].size());
    Min = min(Min, (int)arr[i].size());
  }
  if (Max == 1 && Min == 1) {
    printf("Possible\n");
    for (int i = 0; i < m; i++) printf("%d ", arr[i][0] + 1);
    printf("\n");
  } else if (Min == 0)
    printf("Impossible\n");
  else
    printf("Ambiguity\n");
  return 0;
}
