#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAXN = 1e5 + 5;
int n, m;
int f[MAXN], b[MAXN], ans[MAXN];
map<int, int> mp;
bool flag1 = false, flag2 = false;
int main(int argc, char const *argv[]) {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &f[i]);
    if (mp.count(f[i]))
      mp[f[i]] = -1;
    else
      mp[f[i]] = i;
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &b[i]);
    if (!mp.count(b[i]))
      flag1 = true;
    else if (mp[b[i]] < 0)
      flag2 = true;
    else
      ans[i] = mp[b[i]];
  }
  if (flag1)
    printf("Impossible\n");
  else if (flag2)
    printf("Ambiguity\n");
  else {
    printf("Possible\n");
    for (int i = 1; i <= m; ++i) printf("%d ", ans[i]);
    printf("\n");
  }
  return 0;
}
