#include <bits/stdc++.h>
using namespace std;
long long a, b = 0, c, d, k, i, j, n, m, r, l;
vector<long long> v, v1, v2;
map<int, int> mmap1, mmap2;
long long Search(long long w) {
  int j;
  for (j = 0; j < n; j++) {
    if (v1[j] == w) return j + 1;
  }
}
int main() {
  cin >> n >> m;
  v1.resize(n + 1);
  for (i = 0; i < n; i++) {
    cin >> k;
    mmap1[k]++;
    v1[k] = i;
  }
  for (i = 0; i < m; i++) {
    cin >> k;
    v.push_back(k);
    mmap2[k]++;
  }
  for (i = 0; i < m; i++) {
    if (mmap1[v[i]] == 0) return cout << "Impossible", 0;
    if (mmap1[v[i]] > 1)
      b = 1;
    else if ((mmap1[v[i]] == mmap2[v[i]]) && (b != 1))
      ;
    { v2.push_back(v1[v[i]]); }
  }
  if (b == 1) return cout << "Ambiguity", 0;
  cout << "Possible" << endl;
  for (i = 0; i < v2.size(); i++) {
    cout << v2[i] + 1 << ' ';
  }
  return 0;
}
