#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 77;
const int MOD = 1e9 + 7;
int n, m, f[N], b[N], ans[N];
vector<int> pos[N];
string s = "Possible";
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", f + i);
    pos[f[i]].push_back(i);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", b + i);
    if (pos[b[i]].size() == 0) return printf("Impossible"), 0;
    if (pos[b[i]].size() > 1) s = "Ambiguity";
    ans[i] = pos[b[i]].back();
  }
  for (int i = 0; i < s.size(); i++) {
    printf("%c", s[i]);
  }
  if (s[0] == 'A') return 0;
  printf("\n");
  for (int i = 1; i <= m; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
