#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
double distsqr(double x, double y, double a, double b) {
  return sqr((x - a)) + sqr((y - b));
}
double cosine_angle(double a, double b, double c) {
  return (double)(sqr(a) + sqr(b) - sqr(c)) / ((double)2.0 * a * b);
}
template <class T>
T Maximum(T a, T b) {
  return a > b ? a : b;
}
template <class T>
T Minimum(T a, T b) {
  return a < b ? a : b;
}
template <class T>
T GCD(T a, T b) {
  if (!b) return a;
  return GCD(b, a % b);
}
template <class T>
void SWAP(T &a, T &b) {
  T temp = a;
  a = b;
  b = temp;
  return;
}
template <class T>
T sign(T a) {
  return a < 0 ? -1 : 1;
}
template <class T>
T BigMod(T a, T n, T mod) {
  if (!n) return (T)1 % mod;
  long long int power = BigMod(a, n >> 1, mod);
  power %= mod;
  power *= power;
  power %= mod;
  if (n & 1) power *= a % mod, power %= mod;
  return power;
}
template <class T>
T ExtendedEuclid(T a, T b, T c) {
  if (!a) return 0;
  return (b * ExtendedEuclid(b % a, a, -c) + c) / a;
}
template <class T>
T ModInverse(T a, T m) {
  return ((ExtendedEuclid(a, m, (T)GCD(a, m))) % (m) + (m)) % (m);
}
int f[100010], b[100010];
vector<int> place[100010];
vector<int>::iterator it;
int main() {
  int i, n, m, state;
  scanf("%d %d", &n, &m);
  for (i = state = 0; i < n; i++)
    scanf("%d", f + i), place[f[i]].push_back(i + 1);
  for (i = state = 0; i < m && (state != 2); i++) {
    scanf("%d", &n);
    if (place[n].size() == 1)
      b[i] = place[n].back();
    else if (place[n].size())
      state = 1;
    else
      state = 2;
  }
  if (state)
    printf("%s\n", state == 1 ? "Ambiguity" : "Impossible");
  else {
    printf("Possible\n");
    for (i = 0; i < m; i++) {
      if (i) printf(" ");
      printf("%d", b[i]);
    }
  }
  return 0;
}
