#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
int f[maxn];
int b[maxn];
int a[maxn];
int adj[maxn];
vector<int> g[maxn];
string pick[] = {"", ""};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> f[i];
    adj[f[i]]++;
    g[f[i]].push_back(i + 1);
  }
  int pos = 0, am = 0, impos = 0;
  for (int j = 0; j < m; ++j) {
    int x;
    cin >> x;
    b[j] = x;
    if (adj[x] == 0) impos = 1;
    if (adj[x] > 1) am = 1;
  }
  if (impos) {
    cout << "Impossible";
  } else if (am) {
    cout << "Ambiguity";
  } else {
    memset(adj, 0, sizeof(adj));
    cout << "Possible\n";
    for (int i = 0; i < m; ++i) {
      int x = b[i];
      cout << g[x][0] << " ";
    }
  }
  return 0;
}
