#include <bits/stdc++.h>
using namespace std;
const int SIZE = 100000;
int main() {
  int n, m, f[SIZE], b[SIZE];
  bool was[SIZE];
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    f[i] = -1;
    was[i] = false;
  }
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    --t;
    if (f[t] != -1) was[t] = true;
    f[t] = i;
  }
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
    --b[i];
    if (f[b[i]] == -1) {
      cout << "Impossible" << endl;
      return 0;
    }
  }
  for (int i = 0; i < m; ++i)
    if (was[b[i]]) {
      cout << "Ambiguity" << endl;
      return 0;
    }
  cout << "Possible" << endl;
  for (int i = 0; i < m - 1; ++i) cout << f[b[i]] + 1 << ' ';
  cout << f[b[m - 1]] + 1 << endl;
  return 0;
}
