#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, c;
  cin >> n;
  vector<int> a(n), color(n);
  vector<vector<int>> grp(n + 1);
  c = 1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    grp[n - a[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    if (grp[i].size() % i != 0) {
      cout << "Impossible\n";
      return 0;
    }
    for (int j = 0; j < grp[i].size(); j += i) {
      for (int k = j; k < j + i; k++) {
        color[grp[i][k]] = c;
      }
      c++;
    }
  }
  cout << "Possible\n";
  for (int i = 0; i < n; i++) cout << color[i] << " ";
  cout << "\n";
  return 0;
}
