#include <bits/stdc++.h>
using namespace std;
const long double E = 1e-8;
const long long MOD = 1e9 + 7;
const int MAX = 1e5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  bool res = true;
  int n, m;
  cin >> n >> m;
  int ans[m];
  vector<int> vec[n + 1];
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    vec[a].push_back(i + 1);
  }
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    if (vec[a].empty()) {
      cout << "Impossible";
      exit(0);
    }
    if (vec[a].size() > 1) {
      res = false;
      continue;
    }
    ans[i] = vec[a][0];
  }
  if (res) {
    cout << "Possible"
         << "\n";
    for (int i = 0; i < m; i++) cout << ans[i] << " ";
  } else {
    cout << "Ambiguity";
  }
}
