#include <bits/stdc++.h>
using namespace std;
int b[100005], n;
pair<int, int> a[100005];
int dem = 0;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    int x = n - a[i].first - 1;
    if (x > n) {
      cout << "Impossible";
      exit(0);
    }
    if (a[i].first == a[i + x].first) {
      dem++;
      for (int j = i; j <= i + x; j++) {
        b[a[j].second] = dem;
      }
    } else {
      cout << "Impossible";
      exit(0);
    }
    i = i + x;
  }
  cout << "Possible"
       << "\n";
  for (int i = 1; i <= n; i++) cout << b[i] << " ";
}
