#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
const int INF = 0x3f3f3f3f;
void read(int &val) {
  int x = 0;
  int bz = 1;
  char c;
  for (c = getchar(); (c < '0' || c > '9') && c != '-'; c = getchar())
    ;
  if (c == '-') {
    bz = -1;
    c = getchar();
  }
  for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - 48;
  val = x * bz;
}
struct node {
  int id, val;
} q[maxn];
bool cmp(node a1, node a2) { return a1.val < a2.val; }
int n;
int ANS[maxn];
int main() {
  read(n);
  int v, flag = 0;
  for (int i = 1; i <= n; i++) {
    read(v);
    q[i].id = i;
    q[i].val = v;
  }
  sort(q + 1, q + 1 + n, cmp);
  int last = 1;
  long long sum = 0;
  int cnt = 0;
  while (1) {
    int t = last + (n - q[last].val) - 1;
    if (q[t].val == q[last].val) {
      cnt++;
      for (int j = last; j <= t; j++) ANS[q[j].id] = cnt;
      sum += (n - q[last].val);
      last = t + 1;
      if (t == n) break;
    } else {
      printf("Impossible\n");
      return 0;
    }
  }
  if (sum != n)
    printf("Impossible\n");
  else {
    printf("Possible\n");
    for (int i = 1; i <= n; i++) printf("%d ", ANS[i]);
    printf("\n");
  }
  return 0;
}
