#include <bits/stdc++.h>
using namespace std;
int a[100000], f[100000], b[100000];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    a[x] = i;
    f[x]++;
  }
  bool ambiguity = false;
  bool can = true;
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    if (f[b[i]] > 1)
      ambiguity = true;
    else if (f[b[i]] == 0)
      can = false;
  }
  if (can) {
    if (ambiguity)
      printf("Ambiguity\n");
    else {
      printf("Possible\n");
      for (int i = 1; i <= m; i++) {
        printf("%d ", a[b[i]]);
      }
      puts("");
    }
  } else
    printf("Impossible\n");
  return 0;
}
