#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  unordered_map<int, int> count;
  vector<int> hats(n);
  for (int i = 0; i < n; i++) {
    cin >> hats[i];
    hats[i] = n - hats[i];
    count[hats[i]]++;
  }
  bool isPossible = true;
  for (auto& item : count) {
    if (item.second % item.first != 0) {
      isPossible = false;
      break;
    }
  }
  if (isPossible) {
    cout << "Possible" << endl;
    unordered_map<int, int> group;
    vector<int> count2(n, 0);
    int groupno = 0;
    for (int i = 0; i < n; i++) {
      if (group.find(hats[i]) == group.end()) {
        groupno++;
        group[hats[i]] = groupno;
        cout << groupno << " ";
        if (hats[i] != 1)
          count2[hats[i]]++;
        else {
          group.erase(1);
        }
      } else {
        count2[hats[i]]++;
        cout << group[hats[i]] << " ";
        if (count2[hats[i]] == hats[i]) {
          group.erase(hats[i]);
          count2[hats[i]] = 0;
        }
      }
    }
    cout << endl;
  } else
    cout << "Impossible" << endl;
  return 0;
}
