#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> pos[100010];
int res[100010];
int main(void) {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int a;
    scanf("%d", &a);
    pos[a].push_back(i);
  }
  int cc = 0;
  bool flag = 1;
  for (int i = 0; i < n; ++i) {
    int inb = n - i;
    int cnt = pos[i].size();
    if (cnt % inb) {
      flag = 0;
      break;
    }
    for (int j = 0; j < cnt / inb; ++j) {
      int t = j * inb;
      ++cc;
      for (int k = inb - 1; ~k; --k) {
        res[pos[i][t + k]] = cc;
      }
    }
  }
  if (flag) {
    puts("Possible");
    for (int i = 1; i <= n; ++i) {
      printf("%d ", res[i]);
    }
  } else {
    puts("Impossible");
  }
  return 0;
}
