#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n, m;
int a[MAXN], f[MAXN], v[MAXN];
bool ambg;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    f[x] = i;
    v[x]++;
  }
  for (int i = 1; i <= m; i++) {
    int x;
    cin >> x;
    if (!f[x]) {
      cout << "Impossible";
      return 0;
    } else {
      if (v[x] > 1) ambg = 1;
      a[i] = f[x];
    }
  }
  if (ambg) {
    cout << "Ambiguity";
    return 0;
  }
  cout << "Possible\n";
  for (int i = 1; i <= m; i++) cout << a[i] << ' ';
  return 0;
}
