#include <bits/stdc++.h>
using namespace std;
int n, m;
int f[100005];
int b[100005];
bool exf[100005];
bool frep[100005];
bool frepeated = false;
bool bout = false;
int finv[100005];
int main() {
  cin >> n >> m;
  for (int z = 1; z <= n; z++) {
    exf[z] = false;
    frep[z] = false;
  }
  for (int i = 1; i <= n; i++) {
    cin >> f[i];
    if (exf[f[i]]) frep[f[i]] = true;
    exf[f[i]] = true;
  }
  for (int j = 1; j <= m; j++) {
    cin >> b[j];
    if (!exf[b[j]]) bout = true;
    if (frep[b[j]]) frepeated = true;
  }
  if (bout)
    cout << "Impossible\n";
  else if (frepeated)
    cout << "Ambiguity\n";
  else {
    cout << "Possible\n";
    for (int u = 1; u <= n; u++) {
      finv[f[u]] = u;
    }
    for (int v = 1; v <= m; v++) {
      cout << finv[b[v]] << " ";
    }
    cout << "\n";
  }
  return 0;
}
