#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const int MAXN = 100005;
int n, m;
int f[MAXN], b[MAXN], a[MAXN];
vector<vector<int> > v;
bool imp, amb;
void solve() {
  v.resize(MAXN);
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &f[i]);
    v[f[i]].push_back(i);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
    if (v[b[i]].empty()) {
      printf("Impossible\n");
      return;
    }
    if (v[b[i]].size() > 1) {
      amb = true;
    } else {
      a[i] = v[b[i]][0];
    }
  }
  if (amb) {
    printf("Ambiguity\n");
  } else {
    printf("Possible\n");
    for (int i = 1; i <= m; i++) {
      printf("%d ", a[i]);
    }
  }
}
int main() {
  srand(1337);
  solve();
  return 0;
}
