#include <bits/stdc++.h>
using namespace std;
int b[100005], f[100005], i, c[100005], v[100005], n, m;
bool flag1 = 0, flag2 = 0;
int main() {
  memset(c, 0, sizeof(c));
  cin >> n >> m;
  for (i = 1; i <= n; i++) cin >> f[i], c[f[i]]++, v[f[i]] = i;
  for (i = 1; i <= m; i++) cin >> b[i];
  for (i = 1; i <= m; i++) {
    if (c[b[i]] == 0) {
      flag1 = 1;
    }
    if (c[b[i]] > 1) {
      flag2 = 1;
    }
    b[i] = v[b[i]];
  }
  if (flag1)
    cout << "Impossible\n";
  else if (flag2)
    cout << "Ambiguity\n";
  else {
    cout << "Possible\n";
    for (i = 1; i <= m; i++) cout << b[i] << " ";
    cout << "\n";
  }
  return 0;
}
