#include <bits/stdc++.h>
using namespace std;
vector<int> f[100005];
int n, m, temp, flag = 0;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    f[temp].push_back(i + 1);
  }
  int j = 0, ans[100005];
  for (int i = 0; i < m; i++) {
    cin >> temp;
    if (f[temp].size() == 0) {
      flag = 2;
      break;
    } else if (f[temp].size() > 1 && flag != 2) {
      flag = 1;
    } else if (flag == 0) {
      ans[j++] = f[temp][0];
    }
  }
  if (flag == 0) {
    cout << "Possible\n";
    for (int i = 0; i < m; i++) cout << ans[i] << " ";
    cout << endl;
  } else if (flag == 1) {
    cout << "Ambiguity\n";
  } else {
    cout << "Impossible\n";
  }
  return 0;
}
