#include <bits/stdc++.h>
using namespace std;
class node {
 public:
  long long int second;
  long long int length;
};
void FastIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  FastIO();
  long long int n, m, i;
  cin >> n >> m;
  long long int f[n], b[m];
  multimap<long long int, long long int> a;
  for (i = 0; i < n; i++) {
    cin >> f[i];
    a.insert(make_pair(f[i], i));
  }
  for (i = 0; i < m; i++) {
    cin >> b[i];
  }
  vector<long long int> c;
  bool flag = 0;
  pair<multimap<long long int, long long int>::iterator,
       multimap<long long int, long long int>::iterator>
      mypair;
  for (i = 0; i < m; i++) {
    if (a.count(b[i]) > 1) {
      flag = 1;
    } else if (a.count(b[i]) == 0) {
      cout << "Impossible\n";
      return 0;
    } else {
      mypair = a.equal_range(b[i]);
      c.push_back(mypair.first->second + 1);
    }
  }
  if (flag == 1) {
    cout << "Ambiguity\n";
    return 0;
  }
  cout << "Possible\n";
  for (i = 0; i < m - 1; i++) cout << c[i] << " ";
  cout << c[i] << endl;
  return 0;
}
