#include <bits/stdc++.h>
using namespace std;
long long n, a[100001], b[100001];
vector<long long> v[100001];
signed main() {
  cin >> n;
  long long i;
  for (i = 1; i < n + 1; i++) {
    cin >> a[i];
    v[a[i]].push_back(i);
  }
  bool ok = 1;
  long long clr = 1;
  for (i = 0; i < 100001; i++) {
    if (!v[i].empty()) {
      long long k = v[i].size();
      long long j;
      if (k % (n - i) != 0) {
        ok = 0;
        break;
      }
      long long t = k / (n - i);
      long long temp = 1;
      j = 0;
      while (temp <= t) {
        while (j < temp * (n - i)) {
          b[v[i][j]] = clr;
          j++;
        }
        clr++;
        temp++;
      }
    }
  }
  if (ok) {
    cout << "Possible\n";
    for (i = 1; i < n + 1; i++) cout << b[i] << " ";
  } else
    cout << "Impossible";
}
