#include <bits/stdc++.h>
using namespace std;
map<int, vector<int> > mp;
int main() {
  int n, m;
  cin >> n >> m;
  int *b = new int[m];
  int *bb = new int[m];
  int *f = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> f[i];
    mp[f[i]].push_back(i);
  }
  for (int i = 0; i < m; i++) {
    int t;
    cin >> bb[i];
    if (mp[bb[i]].size() == 0) {
      cout << "Impossible";
      return 0;
    }
  }
  for (int i = 0; i < m; i++) {
    if (mp[bb[i]].size() > 1) {
      cout << "Ambiguity";
      return 0;
    }
  }
  for (int i = 0; i < m; i++) {
    b[i] = mp[bb[i]][0] + 1;
  }
  cout << "Possible" << endl;
  for (int i = 0; i < m; i++) {
    cout << b[i] << " ";
  }
}
