#include <bits/stdc++.h>
using namespace std;
double esp = 1e-12;
const long double PI = acos(-1.0);
const long long int INF = 0x3f3f3f3f;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
int b[100001], f[100001];
int is[100001], p[100001];
int main() {
  int n, m;
  memset(is, 0, sizeof(is));
  scanf("%d%d", &n, &m);
  for (int x = 1; x <= n; x++) {
    scanf("%d", &f[x]);
    is[f[x]]++;
    p[f[x]] = x;
  }
  for (int x = 1; x <= m; x++) scanf("%d", &b[x]);
  for (int x = 1; x <= m; x++)
    if (is[b[x]] == 0) {
      printf("Impossible\n");
      return 0;
    }
  for (int x = 1; x <= m; x++)
    if (is[b[x]] > 1) {
      printf("Ambiguity\n");
      return 0;
    }
  printf("Possible\n");
  for (int x = 1; x <= m; x++) {
    printf("%d ", p[b[x]]);
  }
  return 0;
}
