#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(const char& ch) { return "'" + string(1, ch) + "'"; }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << " " << to_string(H);
  debug_out(T...);
}
template <typename T>
using mxpq = priority_queue<T>;
template <typename T>
using mnpq = priority_queue<T, vector<T>, greater<T>>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int64_t rand(int64_t a, int64_t b) {
  return uniform_int_distribution<int64_t>(a, b)(rng);
}
template <typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& a) {
  in >> a.first >> a.second;
  return in;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2>& a) {
  out << a.first << " " << a.second;
  return out;
}
template <class A, size_t S>
istream& operator>>(istream& in, array<A, S>& a) {
  for (A& x : a) in >> x;
  return in;
}
template <class A, size_t S>
ostream& operator<<(ostream& out, array<A, S>& a) {
  bool f = false;
  for (A& x : a) {
    if (f) out << " ";
    out << x;
    f = true;
  }
  return out;
}
template <typename T>
istream& operator>>(istream& in, vector<T>& a) {
  for (T& x : a) in >> x;
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T>& a) {
  bool f = false;
  for (T& x : a) {
    if (f) out << " ";
    out << x;
    f = true;
  }
  return out;
}
void out(bool ok, bool cap = true) {
  if (cap)
    cout << (ok ? "YES" : "NO") << '\n';
  else
    cout << (ok ? "Yes" : "No") << '\n';
}
template <typename T, typename T1>
T amax(T& a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T amin(T& a, T1 b) {
  if (b < a) a = b;
  return a;
}
const int64_t mod = 1e9 + 7;
const int64_t INF = 1e18L + 5;
const int64_t N = 2e5 + 5;
void solve() {
  int64_t n, m;
  cin >> n >> m;
  map<int64_t, vector<int64_t>> mp;
  for (int64_t i = 1; i <= n; i++) {
    int64_t x;
    cin >> x;
    mp[x].push_back(i);
  }
  vector<int64_t> a(m);
  cin >> a;
  bool Impossible = false, Ambiguity = false;
  for (int64_t i = 0; i < m; i++) {
    auto& vec = mp[a[i]];
    if (vec.empty()) {
      Impossible = true;
    } else if ((int64_t)(vec).size() > 1) {
      Ambiguity = true;
    } else {
      a[i] = vec.back();
    }
  }
  if (Impossible) {
    cout << "Impossible\n";
  } else if (Ambiguity) {
    cout << "Ambiguity\n";
  } else {
    cout << "Possible\n" << a;
  }
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int64_t t = 1;
  for (int64_t tt = 1; tt <= t; tt++) solve();
  return 0;
}
