#include <bits/stdc++.h>
using namespace std;
const int MAX = 100050;
bool vis[MAX];
int f[MAX], b[MAX];
int counts[MAX], pos[MAX];
int a[MAX];
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(counts, 0, sizeof(counts));
    memset(pos, -1, sizeof(pos));
    for (int i = 1; i <= n; i++) {
      scanf("%d", &f[i]);
      counts[f[i]]++;
      pos[f[i]] = i;
    }
    for (int i = 1; i <= m; i++) {
      scanf("%d", &b[i]);
    }
    bool flag1 = true, flag2 = true;
    for (int i = 1; i <= m; i++) {
      if (counts[b[i]] > 1) {
        flag2 = false;
      } else if (counts[b[i]] == 0) {
        puts("Impossible");
        flag1 = false;
        break;
      } else {
        a[i] = pos[b[i]];
      }
    }
    if (flag1) {
      if (!flag2) {
        puts("Ambiguity");
        continue;
      }
    }
    if (flag1 && flag2) {
      puts("Possible");
      cout << a[1];
      for (int i = 2; i <= m; i++) {
        printf(" %d", a[i]);
      }
      puts("");
    }
  }
  return 0;
}
