#include <bits/stdc++.h>
const int maxn = 100006;
const long long inf = 1000000009;
using namespace std;
const int N = 100001;
int f[N];
int b[N];
int a[N];
struct node {
  int i;
  int n;
} flag[N];
int main(void) {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    int i;
    int ans = 0;
    memset(flag, 0, sizeof(flag));
    for (i = 1; i <= n; i++) {
      scanf("%d", &f[i]);
      flag[f[i]].i = i;
      flag[f[i]].n++;
    }
    for (i = 1; i <= m; i++) {
      scanf("%d", &b[i]);
      if (flag[b[i]].n == 0) {
        ans = 1;
      }
    }
    if (ans)
      printf("Impossible\n");
    else {
      for (i = 1; i <= m; i++) {
        a[i] = flag[b[i]].i;
        if (flag[b[i]].n > 1) ans = 1;
      }
      if (ans)
        printf("Ambiguity\n");
      else {
        printf("Possible\n");
        for (i = 1; i <= m; i++) printf("%d ", a[i]);
        printf("\n");
      }
    }
  }
  return 0;
}
