#include <bits/stdc++.h>
using namespace std;
const int NMAX = 100004;
int cacalau[NMAX], flegma[NMAX], b[NMAX], f[NMAX];
bool cacat, pisat;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = (1); i <= (n); ++i) {
    cin >> f[i];
    if (!cacalau[f[i]])
      cacalau[f[i]] = i;
    else
      cacalau[f[i]] = -1;
  }
  for (int i = (1); i <= (m); ++i) {
    cin >> b[i];
    if (cacalau[b[i]] == 0) {
      pisat = true;
      break;
    }
    if (cacalau[b[i]] == -1) cacat = true;
    if (cacat) continue;
    flegma[i] = cacalau[b[i]];
  }
  if (pisat) {
    cout << "Impossible\n";
    return 0;
  }
  if (cacat) {
    cout << "Ambiguity\n";
    return 0;
  }
  cout << "Possible\n";
  for (int i = 1; i <= m; ++i) cout << flegma[i] << " ";
  return 0;
}
