#include <bits/stdc++.h>
using namespace std;
int n, m, f[100100], b[100100], a[100100], p[100100] = {0};
int main() {
  cin >> n;
  cin >> m;
  for (int i = 1; i <= n; i++) {
    cin >> f[i];
    if (p[f[i]] == 0)
      p[f[i]] = i;
    else
      p[f[i]] = -1;
  }
  int k = 0;
  for (int j = 1; j <= m; j++) {
    cin >> b[j];
    if (p[b[j]] == -1)
      k = 1;
    else if (p[b[j]] == 0) {
      cout << "Impossible";
      return 0;
    } else
      a[j] = p[b[j]];
  }
  if (k == 1)
    cout << "Ambiguity";
  else {
    cout << "Possible" << endl;
    for (int j = 1; j <= m; j++) cout << a[j] << " ";
  }
  return 0;
}
