#include <bits/stdc++.h>
using namespace std;
vector<int> c[100005];
int b[100005], f[100005], a[100005];
int main() {
  int n, m, fl = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> f[i];
    c[f[i]].push_back(i);
  }
  for (int i = 0; i < m; i++) cin >> b[i];
  for (int i = 0; i < m; i++)
    if (c[b[i]].size() == 0) {
      cout << "Impossible\n";
      return 0;
    } else if (c[b[i]].size() == 1)
      a[i] = c[b[i]][0];
    else
      fl = 1;
  if (fl) {
    cout << "Ambiguity\n";
    return 0;
  }
  cout << "Possible\n";
  for (int i = 0; i < m; i++) cout << a[i] + 1 << " ";
  cout << endl;
  return 0;
}
