#include <bits/stdc++.h>
using namespace std;
const int N6 = 1e6 + 6, N3 = 1e3 + 6, oo = 1e9 + 9;
long long n, m, f[N6], b[N6], cnt[N6], ind[N6];
int main() {
  ios_base ::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> f[i];
    cnt[f[i]]++;
    ind[f[i]] = i;
  }
  for (int i = 1; i <= m; ++i) {
    cin >> b[i];
  }
  for (int i = 1; i <= m; ++i) {
    if (!ind[b[i]]) {
      cout << "Impossible";
      return 0;
    }
  }
  for (int i = 1; i <= m; ++i) {
    if (cnt[b[i]] > 1) {
      cout << "Ambiguity";
      return 0;
    }
  }
  cout << "Possible\n";
  for (int i = 1; i <= m; ++i) {
    cout << ind[b[i]] << " ";
  }
  return 0;
}
