#include <bits/stdc++.h>
using namespace std;
int a[100050];
int f[100050];
int b[100050];
vector<int> cnt[100050];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &f[i]);
    cnt[f[i]].push_back(i);
  }
  for (int i = 0; i < m; i++) scanf("%d", &b[i]);
  int flag = 0;
  for (int i = 0; i < m; i++) {
    if (cnt[b[i]].size() == 0) {
      flag = 2;
      break;
    }
    if (cnt[b[i]].size() > 1) flag = 1;
  }
  if (flag == 2)
    printf("Impossible\n");
  else if (flag == 1)
    printf("Ambiguity\n");
  else {
    printf("Possible\n");
    for (int i = 0; i < m; i++)
      if (i == m - 1)
        printf("%d\n", cnt[b[i]][0] + 1);
      else
        printf("%d ", cnt[b[i]][0] + 1);
  }
  return 0;
}
