#include <bits/stdc++.h>
using namespace std;
const int32_t INFint = 1e9;
const long long INFll = 1e18;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  pair<int, int> p[n];
  int x;
  int hash[n];
  for (int i = 0; i < n; i++) hash[i] = 0;
  ;
  for (int i = 0; i < n; i++) {
    cin >> x;
    p[i] = make_pair(x, i);
    hash[x]++;
  }
  sort(p, p + n);
  int check = 1;
  pair<int, int> ans[n];
  int i = 0;
  int len = 0;
  int counter = 1;
  int temp = 0;
  while (i < n) {
    if (hash[p[i].first] < (n - p[i].first)) {
      check = 0;
      cout << "Impossible" << '\n';
      return 0;
    } else {
      len = (n - p[i].first);
      temp = i;
      while (len > 0) {
        ans[i].first = counter;
        ans[i].second = p[i].second;
        i++;
        len--;
      }
      hash[p[temp].first] -= (n - p[temp].first);
      counter++;
    }
  }
  cout << "Possible" << '\n';
  sort(ans, ans + n, sortbysec);
  for (int i = 0; i < n; i++) cout << ans[i].first << " ";
}
