#include <bits/stdc++.h>
inline int Rand() { return (rand() << 16) | rand(); }
using namespace std;
const int N = 100001;
int a[N];
int san[N], san2[N], b[N];
bool imp, amb;
int n, m;
int f[N];
int main() {
  srand(time(NULL));
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    san[a[i]]++;
    f[a[i]] = i;
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
    if (!san[b[i]]) cout << "Impossible", exit(0);
  }
  for (int i = 1; i <= m; i++)
    if (san[b[i]] > 1) cout << "Ambiguity", exit(0);
  cout << "Possible\n";
  for (int i = 1; i <= m; i++) cout << f[b[i]] << " ";
  return 0;
}
