#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  map<long long int, long long int> m;
  map<long long int, long long int> key;
  map<long long int, long long int> hat;
  long long int i;
  long long int h[n];
  long long int k = 1;
  for (i = 0; i < n; i++) {
    cin >> h[i];
    long long int s = n - h[i];
    if (m[s] == 0 || m[s] % s == 0) {
      key[s] = k;
      k++;
    }
    hat[i] = key[s];
    m[s]++;
  }
  for (i = 0; i < n; i++) {
    long long int same = n - h[i];
    if (m[same] % same != 0) {
      cout << "Impossible"
           << "\n";
      return 0;
    }
  }
  cout << "Possible"
       << "\n";
  for (i = 0; i < n; i++) cout << hat[i] << " ";
}
