#include <bits/stdc++.h>
using namespace std;
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcount(s);
}
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
int n, m;
vector<int> V[200005];
int res[200005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = (1); i <= (n); ++i) {
    int x;
    cin >> x;
    V[x].push_back(i);
  }
  int RR = 1;
  for (int i = (1); i <= (m); ++i) {
    int x;
    cin >> x;
    if (V[x].size() > 1 && RR == 1) {
      RR = 2;
    } else if (V[x].size() == 0) {
      RR = 0;
    }
    if (RR == 1) {
      res[i] = V[x][0];
    }
  }
  if (!RR) {
    cout << "Impossible" << endl;
  } else if (RR == 1) {
    cout << "Possible" << endl;
    for (int i = (1); i <= (m); ++i) cout << res[i] << " ";
  } else {
    cout << "Ambiguity" << endl;
  }
  return 0;
}
