#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  vector<int> f(n), b(m);
  for (int& it : f) cin >> it;
  for (int& it : b) cin >> it;
  unordered_map<int, deque<int>> fhas;
  for (int i = 1; i <= n; i++) fhas[f[i - 1]].push_back(i);
  for (int i : b) {
    if (fhas[i].size() == 0) {
      cout << "Impossible\n";
      exit(0);
    }
  }
  deque<int> res;
  for (int i : b) {
    if (fhas[i].size() > 1) {
      cout << "Ambiguity\n";
      exit(0);
    }
    res.push_back(fhas[i][0]);
  }
  cout << "Possible\n";
  for (int i = 0; i < ((int)res.size() - 1); i++) cout << res[i] << " ";
  cout << res[res.size() - 1] << endl;
}
