#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
string yes = "YES";
string no = "NO";
long long t = 0, n = 0, m = 0;
long long x0r(long long x, long long y) { return (x | y) & (~x | ~y); }
bool isPalindrome(string str) {
  int l = 0, h = str.length() - 1;
  while (h > l)
    if (str[l++] != str[h--]) return false;
  return true;
}
int main() {
  cin >> n;
  vector<long long> a[n];
  long long b[n];
  memset(b, 0, sizeof(b));
  for (long long i = 0; i < n; i++) b[i] = n - i;
  for (long long i = 0; i < n; i++) {
    cin >> t;
    a[t].push_back(i);
  }
  long long ans[n + 1];
  long long hol = 0;
  memset(ans, -1, sizeof(ans));
  for (long long t = 0; t < n; t++) {
    long long cnt = 0;
    bool changed = false;
    if (a[t].size()) hol++;
    while (a[t].size()) {
      changed = true;
      long long i = a[t].back();
      if ((cnt + 1) % (n - t + 1) != 0) {
        ans[i] = hol;
        cnt++;
        a[t].pop_back();
      } else {
        cnt++, hol++;
      }
    }
    if ((cnt + 1) % (n - t + 1) != 0 && changed) {
      cout << "Impossible"
           << "\n";
      return 0;
    }
  }
  cout << "Possible"
       << "\n";
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
}
