#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
int Cf[100010];
int Ans[100010];
int Invf[100010];
bool amb = false;
bool imp = false;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N, M, a;
  cin >> N >> M;
  for (int i = 0; i < N; ++i) {
    cin >> a;
    Cf[a]++;
    Invf[a] = i + 1;
  }
  for (int i = 0; i < M; ++i) {
    cin >> a;
    if (Cf[a] == 1)
      Ans[i] = Invf[a];
    else if (Cf[a] == 0)
      imp = true;
    else if (Cf[a] > 1)
      amb = true;
  }
  if (imp)
    cout << "Impossible" << '\n';
  else if (amb)
    cout << "Ambiguity" << '\n';
  else {
    cout << "Possible" << '\n';
    for (int i = 0; i < M - 1; ++i) cout << Ans[i] << " ";
    cout << Ans[M - 1] << '\n';
  }
  return 0;
}
