#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > moc;
vector<int> res;
int main() {
  int n;
  int a;
  scanf("%d", &n);
  moc.resize(n + 1);
  res.resize(n, -1);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    moc[n - a].push_back(i);
  }
  int x = 1, m;
  for (int i = 1; i < n + 1; i++) {
    m = moc[i].size();
    if (m % i != 0) {
      printf("Impossible\n");
      return 0;
    }
    for (int j = 0; j < m / i; j++) {
      for (int l = 0; l < i; l++) res[moc[i][j * i + l]] = x;
      x++;
    }
  }
  printf("Possible\n");
  for (int i = 0; i < n; i++) printf("%d ", res[i]);
  printf("\n");
}
