#include <bits/stdc++.h>
using namespace std;
unordered_map<char, vector<string>> adj;
vector<long long int> vis(100005, 0);
vector<long long int> p(100005, 0);
long long int c[100005];
long long int n, ans = 0;
void dfs(long long int node, long long int len) {
  if (len == n) {
    ans++;
    return;
  }
  for (auto str : adj[node]) dfs(str[0], len + 1);
}
int main() {
  long long int n, m, i;
  cin >> n >> m;
  long long int a, b[m];
  unordered_map<long long int, long long int> mm, m1;
  for (i = 0; i < n; i++) {
    cin >> a;
    mm[a]++;
    m1[a] = i + 1;
  }
  for (i = 0; i < m; i++) cin >> b[i];
  long long int flag = 0;
  for (i = 0; i < m; i++) {
    if (mm[b[i]]) {
      if (mm[b[i]] > 1) {
        flag = 1;
      } else {
        b[i] = m1[b[i]];
      }
    } else {
      cout << "Impossible";
      return 0;
    }
  }
  if (flag) {
    cout << "Ambiguity\n";
    return 0;
  }
  cout << "Possible\n";
  for (i = 0; i < m; i++) cout << b[i] << " ";
}
