#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
bool isnumber(char c) { return c >= '0' && c <= '9'; }
long long getint() {
  char c;
  c = getchar();
  while (!isnumber(c)) c = getchar();
  long long toret = c - '0';
  c = getchar();
  while (isnumber(c)) {
    toret = (toret << 3) + (toret << 1) + c - '0';
    c = getchar();
  }
  return toret;
}
void putint(long long toput) {
  if (toput < 10) {
    putchar('0' + toput);
    return;
  }
  putint(toput / 10);
  putchar('0' + toput % 10);
}
int n, m;
vector<int> f;
vector<int> b;
void input() {
  n = getint();
  m = getint();
  f.resize(n);
  for (int i = 0; i < n; i++) {
    f[i] = getint();
  }
  b.resize(m);
  for (int i = 0; i < m; i++) {
    b[i] = getint();
  }
}
int answerflag;
vector<int> answer;
void solve() {
  vector<int> numtoans(n + 1, -1);
  for (int i = 0; i < n; i++) {
    if (numtoans[f[i]] == -1)
      numtoans[f[i]] = i + 1;
    else
      numtoans[f[i]] = -2;
  }
  for (int i = 0; i < m; i++) {
    if (numtoans[b[i]] == -1) {
      answerflag = -1;
      break;
    }
    if (numtoans[b[i]] == -2) {
      answerflag = -2;
    }
    answer.push_back(numtoans[b[i]]);
  }
}
void output() {
  if (answerflag == -1) {
    cout << "Impossible" << endl;
  } else if (answerflag == -2) {
    cout << "Ambiguity" << endl;
  } else {
    cout << "Possible" << endl;
    for (auto v : answer) cout << v << " ";
  }
}
int main() {
  input();
  solve();
  output();
  return 0;
}
