#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  long long a[100010];
  long long b[100010];
  long long f[100010];
  int vis[100010];
  long long x;
  cin >> n >> m;
  memset(f, 0, sizeof(f));
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (f[x] == 0) f[x] = i + 1;
    vis[x]++;
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < m; i++) {
    if (vis[b[i]] == 0) {
      cout << "Impossible" << endl;
      return 0;
    }
  }
  for (int i = 0; i < m; i++) {
    if (vis[b[i]] > 1) {
      cout << "Ambiguity" << endl;
      return 0;
    }
  }
  for (int i = 0; i < m; i++) a[i] = f[b[i]];
  cout << "Possible" << endl;
  for (int i = 0; i < m; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
