#include <bits/stdc++.h>
int f[100001];
int a[100001];
using namespace std;
int main() {
  bool isAm = false;
  long long int n, m, x;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (f[x] == 0)
      f[x] = i + 1;
    else
      f[x] = -1;
  }
  for (int i = 0; i < m; i++) {
    cin >> x;
    if (f[x] == 0) {
      cout << "Impossible";
      return 0;
    } else if (f[x] != -1) {
      a[i] = f[x];
    } else
      isAm = true;
  }
  if (isAm) {
    cout << "Ambiguity";
    return 0;
  }
  cout << "Possible\n";
  for (int i = 0; i < m; i++) cout << a[i] << " ";
  return 0;
}
