#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
constexpr ll INF = 1e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ;
  int n, m;
  cin >> n >> m;
  int f[n], b[m];
  unordered_map<int, vector<int>> indexmp;
  for (int i = 0; i < n; ++i) {
    cin >> f[i];
    indexmp[f[i]].push_back(i + 1);
  }
  int a[m];
  bool ambi = false;
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
    auto it = indexmp.find(b[i]);
    if (it == indexmp.end()) {
      cout << "Impossible\n";
      return 0;
    }
    if ((it->second).size() > 1) {
      ambi = true;
    }
    a[i] = (it->second).front();
  }
  if (ambi) {
    cout << "Ambiguity\n";
    return 0;
  }
  cout << "Possible\n";
  for (int i : a) {
    cout << i << ' ';
  }
  cout << '\n';
}
