#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  vector<int> a;
  int temp;
  cin >> n;
  vector<int> c(n, 0);
  vector<int> colors(n, 0);
  int curr_color = 0;
  vector<int> sol;
  for (int i = 0; i < n; ++i) {
    cin >> temp;
    if (c[temp] != 0) {
      sol.push_back(colors[temp]);
      --c[temp];
    } else {
      ++curr_color;
      colors[temp] = curr_color;
      sol.push_back(colors[temp]);
      c[temp] = n - temp - 1;
    }
    a.push_back(temp);
  }
  for (int i = 0; i < n; ++i) {
    if (c[i] != 0) {
      cout << "Impossible\n";
      return 0;
    }
  }
  cout << "Possible\n";
  for (int i = 0; i < n; ++i) {
    cout << sol[i] << " ";
  }
  cout << endl;
  return 0;
}
