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