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