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