#include <bits/stdc++.h>
using namespace std;
const int N = 100006;
vector<int> a(N);
vector<int> E[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    E[a[i]].push_back(i);
  }
  int cur = 0;
  vector<int> ans(n + 6);
  for (int i = 0; i < n; i += 1) {
    if (E[i].empty()) continue;
    if ((int)E[i].size() % (n - i)) {
      cout << "Impossible\n";
      return 0;
    }
    for (int l = 0; l < E[i].size(); l += (n - i)) {
      cur += 1;
      for (int k = l; k < l + (n - i); k++) {
        ans[E[i][k]] = cur;
      }
    }
  }
  cout << "Possible\n";
  for (int i = 1; i <= n; i++) cout << ans[i] << ' ';
  return 0;
}
