#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int f[maxn], b[maxn], a[maxn];
vector<int> g[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> f[i];
  for (int i = 1; i <= m; i++) cin >> b[i];
  for (int i = 1; i <= n; i++) g[f[i]].push_back(i);
  bool am = false;
  for (int i = 1; i <= m; i++) {
    if (g[b[i]].size() == 0) {
      cout << "Impossible" << endl;
      return 0;
    }
    if (g[b[i]].size() > 1) am = true;
    a[i] = g[b[i]].back();
  }
  if (am) {
    cout << "Ambiguity" << endl;
    return 0;
  }
  cout << "Possible" << endl;
  for (int i = 1; i <= m; i++) cout << a[i] << " ";
  cout << endl;
  return 0;
}
