#include <bits/stdc++.h>
using namespace std;
int n, m, ans[567890];
bool flag;
struct data {
  int num, id;
  bool operator<(const data& rhs) const { return num < rhs.num; }
} a[567890], b[567890];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i].num), a[i].id = i;
  for (int i = 1; i <= m; i++) scanf("%d", &b[i].num), b[i].id = i;
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  int pos = 1;
  for (int i = 1; i <= m; i++) {
    while (a[pos].num < b[i].num && pos <= n) pos++;
    if (a[pos].num != b[i].num) {
      puts("Impossible");
      return 0;
    }
    ans[b[i].id] = a[pos].id;
    if (a[pos].num == a[pos + 1].num) flag = 1;
  }
  if (flag) {
    puts("Ambiguity");
    return 0;
  }
  puts("Possible");
  for (int i = 1; i <= m; i++) printf("%d ", ans[i]);
  return 0;
}
