#include <bits/stdc++.h>
using namespace std;
int n, m;
bool use[100009];
int flag[100009];
int b[100009];
int f[100009];
int main() {
  cin >> n >> m;
  bool f1, f2;
  memset(flag, 0, sizeof(flag));
  memset(use, false, sizeof(use));
  f1 = f2 = true;
  int temp;
  for (int i = 1; i <= n; i++) {
    scanf("%d", f + i);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", b + i);
    use[b[i]] = true;
  }
  for (int i = 1; i <= n; i++) {
    if (use[f[i]] && flag[f[i]]) f1 = false;
    flag[f[i]] = i;
  }
  for (int i = 1; i <= m; i++) {
    if (flag[b[i]] == 0) f2 = false;
  }
  if (!f2)
    puts("Impossible");
  else {
    if (!f1)
      puts("Ambiguity");
    else {
      puts("Possible");
      for (int i = 1; i <= m; i++) {
        printf("%d", flag[b[i]]);
        putchar((i == m) ? '\n' : ' ');
      }
    }
  }
  return 0;
}
