#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return N |= (1LL << pos); }
int Reset(int N, int pos) { return N &= ~(1LL << pos); }
bool Check(int N, int pos) { return N & (1LL << pos); }
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1}, dy[] = {1, -1, 0, 0, 1, -1, -1, 1};
inline void cn(long &n) {
  n = 0;
  long ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  n = n * sign;
}
template <class T>
void cmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
void cmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
int len(const T &c) {
  return (int)c.size();
}
template <class T>
int len(char c[]) {
  return (int)strlen(c);
}
long stoi(string s) {
  long n = 0;
  for (int i(0), _n(len(s)); i < _n; ++i) n = n * 10 + (s[i] - 48);
  return n;
}
long n, m, f, ar[100005] = {0}, flag = 0, flag1 = 0, res[100005] = {0},
              pos[100005], b;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i(1), _n(n); i <= _n; ++i) {
    cin >> f;
    ar[f]++;
    pos[f] = i;
  }
  for (int i(0), _n(m); i < _n; ++i) {
    cin >> b;
    if (ar[b] == 0) flag = 1;
    if (ar[b] > 1) flag1 = 1;
    res[i] = pos[b];
  }
  if (flag == 1)
    cout << "Impossible\n";
  else if (flag1 == 1)
    cout << "Ambiguity\n";
  else {
    cout << "Possible\n";
    for (int i(0), _n(m); i < _n; ++i) cout << res[i] << " ";
  }
  return 0;
}
