#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100000 + 1];
int main() {
  int n, j = 1;
  cin >> n;
  vector<long long int> a(n);
  vector<long long int> b(n + 1, 0);
  vector<long long int> c(n);
  for (long long int i = 0; i < n;
       b[n - a[i]]++, adj[n - a[i]].push_back(i), i++)
    cin >> a[i];
  for (long long int i = 1; i <= n; i++)
    if (b[i] % i != 0) {
      cout << "Impossible";
      return 0;
    } else {
      long long int counter = b[i] / i;
      for (long long int ii = 1; ii <= counter; ii++) {
        for (long long int k = 1; k <= i; k++) {
          c[adj[i].back()] = j;
          adj[i].pop_back();
        }
        j++;
      }
    }
  cout << "Possible\n";
  for (long long int i = 0; i < c.size(); i++) cout << c[i] << " ";
  return 0;
}
