#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> all;
  vector<int> ori;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    all.push_back(t);
    ori.push_back(t);
  }
  sort(all.begin(), all.end());
  vector<stack<int>> res(n);
  bool ok = true;
  int curr = 1;
  for (int i = 0; i < n; i++) {
    int currval = all[i];
    int hastobesame = n - currval - 1;
    res[currval].push(curr);
    for (int j = i + 1; j < i + hastobesame + 1; j++) {
      if (all[j] != currval) {
        ok = false;
      } else {
        res[currval].push(curr);
      }
    }
    curr++;
    i += hastobesame;
  }
  if (ok) {
    cout << "Possible\n";
    for (int i = 0; i < n; i++) {
      cout << res[ori[i]].top() << " ";
      res[ori[i]].pop();
    }
  } else {
    cout << "Impossible\n";
  }
}
