#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100500;
vector<int> inf[MAXN];
int f[MAXN];
int a[MAXN];
int b[MAXN];
int n, m;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> f[i];
    f[i]--;
    inf[f[i]].push_back(i + 1);
  }
  bool big = false;
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
    b[i]--;
    if (inf[b[i]].size() == 0) {
      cout << "Impossible\n";
      return 0;
    }
    if (inf[b[i]].size() > 1) big = true;
    a[i] = inf[b[i]][0];
  }
  if (big) {
    cout << "Ambiguity\n";
    return 0;
  }
  cout << "Possible\n";
  for (int i = 0; i < m; ++i) cout << a[i] << ' ';
  return 0;
}
