#include <bits/stdc++.h>
typedef long long LL;
const double INF = 1e100;
const int oo = ~0u >> 2;
const double pi = acos(-1.0);
const double EPS = 1e-8;
const int MAXN = 100033;
int n, m;
int f[MAXN], b[MAXN];
int a[MAXN];
int vis[MAXN];
int cnt[MAXN];
bool ctf = 0;
int main() {
  scanf("%d%d", &n, &m);
  memset(vis, 0, sizeof vis);
  for (int i = (1), __ = (n); i <= __; ++i) {
    scanf("%d", f + i);
    ++cnt[f[i]];
    vis[f[i]] = i;
  }
  for (int i = (1), __ = (m); i <= __; ++i) {
    scanf("%d", b + i);
    if (vis[b[i]] == 0) {
      puts("Impossible");
      return 0;
    }
  }
  for (int i = (1), __ = (m); i <= __; ++i)
    if (cnt[b[i]] > 1) {
      puts("Ambiguity");
      return 0;
    }
  puts("Possible");
  for (int i = (1), __ = (m); i <= __; ++i) printf("%d ", vis[b[i]]);
  return 0;
}
