#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int MOD = 1e9 + 7;
const int N = 1e6 + 10;
vector<int> pos[N];
int f[N], b[N], a[N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &f[i]);
    pos[f[i]].push_back(i + 1);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &b[i]);
  }
  int can = 1;
  int re = 0;
  for (int i = 0; i < m; i++) {
    int x = b[i];
    if (pos[x].size() == 0) {
      can = 0;
    } else if (pos[x].size() > 1) {
      re = 1;
    } else {
      a[i + 1] = pos[x].back();
    }
  }
  if (can == 0)
    puts("Impossible");
  else if (can == 1 && re == 1)
    puts("Ambiguity");
  else {
    puts("Possible");
    for (int i = 1; i <= m; i++) printf("%d ", a[i]);
  }
  return 0;
}
