#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, no;
  cin >> n;
  vector<int> v(n + 1, 0), l(n);
  for (i = 0; i < n; i++) {
    cin >> no;
    no = n - no;
    l[i] = no;
    v[no]++;
  }
  for (i = 1; i <= n; i++)
    if (v[i] && v[i] % i) break;
  if (i <= n)
    cout << "Impossible";
  else {
    cout << "Possible\n";
    vector<int> val(n + 1, 0);
    int index = 1;
    for (i = 0; i < n; i++) {
      if (v[l[i]] % l[i] == 0) {
        val[l[i]] = index;
        cout << index << " ";
        index++;
        v[l[i]]--;
      } else {
        cout << val[l[i]] << " ";
        v[l[i]]--;
      }
    }
  }
  return 0;
}
