#include <bits/stdc++.h>
using namespace std;
int cnt[100005], place[100005], ans[100005];
int n, m;
int main(int argc, char const *argv[]) {
  memset(cnt, 0, sizeof(cnt));
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    cnt[a]++;
    place[a] = i;
  }
  int flag = 0;
  for (int i = 0; i < m; i++) {
    int a;
    scanf("%d", &a);
    ans[i] = place[a];
    if (cnt[a] == 0) {
      flag = -1;
      break;
    } else if (cnt[a] > 1)
      flag = 1;
  }
  if (flag == -1)
    printf("Impossible\n");
  else if (flag == 1)
    printf("Ambiguity\n");
  else {
    printf("Possible\n");
    for (int i = 0; i < m; i++) printf("%d ", ans[i] + 1);
  }
  return 0;
}
