#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[200001], ans[200001], c = 0;
  vector<int> v[200001];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    a[i] = n - a[i];
  }
  for (int i = 0; i < n; ++i) {
    v[a[i]].push_back(i);
  }
  for (int i = 1; i <= n; ++i) {
    if (v[i].size() % i != 0) {
      cout << "Impossible\n";
      return 0;
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < v[i].size(); j += i) {
      c++;
      for (int k = 0; k < i; ++k) {
        ans[v[i][j + k]] = c;
      }
    }
  }
  cout << "Possible\n";
  for (int i = 0; i < n; ++i) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
