#include <bits/stdc++.h>
using namespace std;
bool comparefirst(pair<int, int> a, pair<int, int> b) {
  return (a.first < b.first);
}
int n, m;
int b[100000];
int a[100000];
vector<pair<int, int> > f;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    f.push_back(make_pair(x, i));
  }
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(f.begin(), f.end(), comparefirst);
  int status = 1;
  pair<int, int> temp;
  for (int i = 0; i < m; i++) {
    temp.first = b[i];
    if (!binary_search(f.begin(), f.end(), temp, comparefirst)) {
      status = 0;
      break;
    }
  }
  if (status == 1) {
    for (int i = 0; i < m; i++) {
      temp.first = b[i];
      if (lower_bound(f.begin(), f.end(), temp, comparefirst) + 1 ==
          upper_bound(f.begin(), f.end(), temp, comparefirst))
        a[i] = lower_bound(f.begin(), f.end(), temp, comparefirst)->second + 1;
      else {
        status = 2;
        break;
      }
    }
  }
  switch (status) {
    case 0:
      cout << "Impossible";
      break;
    case 2:
      cout << "Ambiguity";
      break;
    case 1:
      cout << "Possible\n";
      for (int i = 0; i < m; i++) cout << a[i] << " ";
      break;
    default:
      break;
  }
  return 0;
}
