#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long dx[] = {-1, 0, 1, 0};
long long dy[] = {0, -1, 0, 1};
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  map<long long, vector<long long>> v;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    v[n - x].push_back(i);
  }
  vector<long long> ans(n, 0);
  long long c = 1;
  for (auto a : v) {
    vector<long long> x = a.second;
    if (x.size() % a.first != 0) {
      cout << "Impossible\n";
      return 0;
    }
    for (long long j = 0; j < x.size(); j += a.first) {
      for (long long k = 0; k < a.first; k++) {
        ans[x[j + k]] = c;
      }
      c++;
    }
  }
  cout << "Possible\n";
  for (auto i : ans) cout << i << " ";
  cout << "\n";
}
