#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
vector<int> v[maxn];
int ans[maxn];
int tot = 1;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int rec;
    scanf("%d", &rec);
    v[n - rec].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    if (v[i].size() % i) {
      cout << "Impossible" << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    int cnt = i;
    while (v[i].size()) {
      ans[v[i].back()] = tot;
      v[i].pop_back();
      cnt--;
      if (cnt == 0) {
        cnt = i;
        tot++;
      }
    }
  }
  cout << "Possible" << endl;
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
}
