#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using vll = vector<ll>;
ll const mod = 1e9 + 7;
void solve() {
  ll n, m;
  cin >> n >> m;
  vector<ll> f, b;
  bool possible = true, condition = true;
  map<ll, ll> fkadu, fkapos;
  for (ll i = 0; i < n; i++) {
    ll x;
    cin >> x;
    f.push_back(x);
    fkadu[x]++;
    fkapos[x] = i;
  }
  for (ll i = 0; i < m; i++) {
    ll x;
    cin >> x;
    b.push_back(x);
  }
  for (ll i = 0; i < m; i++) {
    if (fkadu[b[i]] > 1)
      possible = false;
    else if (fkadu[b[i]] == 0)
      possible = false, condition = false;
  }
  if (!possible) {
    if (condition)
      cout << "Ambiguity";
    else
      cout << "Impossible";
    return;
  }
  ll ans[m];
  for (ll i = 0; i < m; i++) {
    ans[i] = fkapos[b[i]] + 1;
  }
  cout << "Possible"
       << "\n";
  for (ll i1 = 0; i1 < m; i1++) cout << ans[i1] << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll testcases = 1;
  while (testcases--) {
    solve();
  }
}
