#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  map<int, int> m;
  int death[n + 1];
  for (int i = 0; i <= n; i++) death[i] = 0;
  for (int i = 0; i < n; i++) {
    if (death[arr[i]] == 0)
      death[arr[i]] = n - arr[i] - 1;
    else
      death[arr[i]]--;
  }
  for (int i = 0; i <= n; i++)
    if (death[i] != 0) {
      cout << "Impossible";
      return 0;
    }
  cout << "Possible\n";
  int c = 1;
  int val[n + 1];
  for (int i = 0; i < n; i++) {
    if (death[arr[i]] == 0) {
      death[arr[i]] = n - arr[i] - 1;
      val[arr[i]] = c++;
    } else
      death[arr[i]]--;
    cout << val[arr[i]] << " ";
  }
  return 0;
}
