#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(n + 1);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] = n - a[i];
    b[a[i]]++;
  }
  for (int i = 1; i < n + 1; i++) {
    if (b[i] % i != 0) {
      cout << "Impossible" << endl;
      return 0;
    }
  }
  cout << "Possible\n";
  vector<int> c(n + 1);
  int curr = 1;
  for (int i = 1; i < n + 1; i++) {
    if (b[i] != 0) c[i] = curr++;
  }
  for (int i = 1; i < n + 1; i++) {
    int ai = a[i - 1];
    int r = c[ai];
    b[ai]--;
    if (b[ai] % ai == 0 && b[ai] != 0) c[ai] = curr++;
    cout << r << " ";
  }
}
