#include <bits/stdc++.h>
using namespace std;
bool compare(pair<int, int> a, pair<int, int> b) {
  return (a.second > b.second);
}
int main() {
  vector<pair<int, int>> vi;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int cin_;
    cin >> cin_;
    cin_ = n - cin_;
    vi.push_back({i, cin_});
  }
  sort(vi.begin(), vi.end(), compare);
  bool possible = true;
  int i = 0;
  while (i < n) {
    if (i == n - 1) {
      if (vi[i].second == 1) break;
      possible = false;
      break;
    }
    int oldi = i;
    if (i != n - 1)
      while (i < n && vi[i].second == vi[i + 1].second) {
        if (i == n - 1) break;
        i++;
      }
    i++;
    int kc = i - oldi;
    if (kc % vi[i - 1].second != 0) {
      possible = false;
      break;
    }
  }
  if (possible == false) {
    cout << "Impossible";
    return 0;
  }
  cout << "Possible\n";
  int change[222222];
  int dem[222222];
  memset(change, -1, sizeof(change));
  memset(dem, 0, sizeof(dem));
  sort(vi.begin(), vi.end());
  int now = 0;
  for (int i = 0; i < n; i++) {
    if (change[vi[i].second] == -1) {
      now++;
      change[vi[i].second] = now;
      cout << now << ' ';
      dem[vi[i].second] = 1;
      continue;
    }
    if (dem[vi[i].second] >= vi[i].second) {
      dem[vi[i].second] = 0;
      change[vi[i].second] = ++now;
    }
    cout << change[vi[i].second] << ' ';
    dem[vi[i].second]++;
  }
  return 0;
}
