#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
vector<int> f(100010), b(100010), fin(100010);
vector<int> arr[100010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, flag = 0;
  cin >> n >> m;
  for (int i = 1; i < n + 1; i++) {
    cin >> f[i];
    arr[f[i]].push_back(i);
  }
  for (int i = 1; i < m + 1; i++) cin >> b[i];
  for (int i = 1; i < m + 1; i++) {
    if ((int)(arr[b[i]].size()) == 0) {
      flag = 1;
      break;
    }
    if ((int)(arr[b[i]].size()) > 1) flag = 2;
    fin[i] = arr[b[i]].back();
  }
  if (flag == 1)
    cout << "Impossible\n";
  else if (flag == 2)
    cout << "Ambiguity\n";
  else {
    cout << "Possible\n";
    for (int i = 1; i < m + 1; i++) cout << fin[i] << " ";
    cout << "\n";
  }
  return 0;
}
