#include <bits/stdc++.h>
using namespace std;
const long long M = 1e5 + 7;
long long pre[M];
signed main() {
  long long n;
  cin >> n;
  long long a[n];
  vector<pair<long long, long long>> v;
  map<long long, long long> mp, mp1;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    v.push_back(make_pair(a[i], i));
  }
  sort(v.begin(), v.end());
  long long diff = n - 1, q = 1;
  for (long long i = 0; i < n; i++) {
    if (v[i].first == diff) {
      mp[v[i].second] = q;
      q++;
      continue;
    }
    mp[v[i].second] = q;
    long long j;
    if (i + 1 > n - 1) return cout << "Impossible", 0;
    for (j = i + 1; j < n; j++) {
      mp[v[j].second] = q;
      diff--;
      if (v[j].first != v[i].first) return cout << "Impossible", 0;
      if (diff == v[i].first) break;
    }
    q++;
    diff = n - 1;
    i = j;
  }
  cout << "Possible"
       << "\n";
  for (long long i = 0; i < n; i++) cout << mp[i] << " ";
  return 0;
}
