#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool fs(T &x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
int f[(int)1e5 + 4], a[(int)1e5 + 4], b[(int)1e5 + 4];
int mark[(int)1e5 + 5] = {};
map<int, int> ara;
int main() {
  int n, m;
  fs(n);
  fs(m);
  for (int i = 1; i < n + 1; i++) {
    fs(f[i]);
    ara[f[i]] = i;
    mark[f[i]]++;
  }
  for (int i = 1; i < m + 1; i++) fs(b[i]);
  for (int i = 1; i <= m; i++) {
    int ans = ara[b[i]];
    if (ans == 0) {
      cout << "Impossible" << endl;
      return 0;
    }
    a[i] = ans;
  }
  for (int i = 1; i <= m; i++) {
    if (mark[b[i]] > 1) {
      cout << "Ambiguity" << endl;
      return 0;
    }
  }
  cout << "Possible" << endl;
  for (int i = 1; i <= m; i++) cout << a[i] << ' ';
  return 0;
}
