#include <bits/stdc++.h>
using int8 = int8_t;
using int16 = int16_t;
using int32 = int32_t;
using int64 = int64_t;
using uint8 = uint8_t;
using uint16 = uint16_t;
using uint32 = uint32_t;
using uint64 = uint64_t;
using byte = uint8_t;
const int8 kInt8Min = 0x80;
const int8 kInt8Max = 0x7F;
const uint8 kUint8Max = 0xFF;
const int16 kInt16Min = 0x8000;
const int16 kInt16Max = 0x7FFF;
const uint16 kUint16Max = 0xFFFF;
const int32 kInt32Min = 0x80000000;
const int32 kInt32Max = 0x7FFFFFFF;
const uint32 kUint32Max = 0xFFFFFFFF;
const int64 kInt64Min = 0x8000000000000000;
const int64 kInt64Max = 0x7FFFFFFFFFFFFFFF;
const uint64 kUint64Max = 0xFFFFFFFFFFFFFFFF;
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
using std::map;
using std::max;
using std::min;
using std::set;
using std::sort;
using std::string;
using std::unordered_map;
using std::unordered_set;
using std::vector;
const double kPi = acos(0.0) * 2.0;
const double kEps = 1e-10;
const int kMod = 1000000007;
const char kWSXS[] = " \n";
struct StaticRunner {
  StaticRunner() { std::ios_base::sync_with_stdio(0); }
} static_runner;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<int> f(n + 1);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &f[i]);
  }
  unordered_map<int, int> reverse_f;
  for (int i = 1; i <= n; i++) {
    int k = i;
    int v = f[i];
    if (reverse_f[v] == 0) {
      reverse_f[v] = k;
    } else {
      reverse_f[v] = -1;
    }
  }
  vector<int> b(m + 1);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
  }
  vector<int> a(m + 1);
  bool multiple_ans = false;
  bool has_ans = true;
  for (int i = 1; i <= m; i++) {
    a[i] = reverse_f[b[i]];
    if (a[i] == 0) {
      has_ans = false;
    }
    if (a[i] == -1) {
      multiple_ans = true;
    }
  }
  if (!has_ans) {
    printf("Impossible\n");
  } else if (multiple_ans) {
    printf("Ambiguity");
  } else {
    printf("Possible\n");
    for (int i = 1; i <= m; i++) {
      printf("%d%c", a[i], kWSXS[i == m]);
    }
  }
  return 0;
}
