#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, m, a[N], b[N];
vector<int> w[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i], w[a[i]].push_back(i);
  for (int i = 0; i <= n - 1; ++i)
    if (!w[i].empty()) {
      int sz = n - i;
      int S = (int)w[i].size();
      if (S % sz) {
        puts("Impossible");
        return 0;
      }
      for (int j = 0; j <= S - 1; ++j) {
        if (j % sz == 0) m++;
        b[w[i][j]] = m;
      }
    }
  puts("Possible");
  for (int i = 1; i <= n; ++i) cout << b[i] << " ";
  puts("");
}
