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