#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
const long long INF = 1e18;
const int B = 1e9 + 7;
vector<int> v[N];
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = int(1); i <= int(n); ++i) {
    cin >> a[i];
    a[i] = n - a[i];
    v[a[i]].push_back(i);
  }
  int c = 0;
  vector<int> ans(n + 1);
  bool bad = 0;
  for (int i = int(1); i <= int(n); ++i) {
    if (!v[i].size()) continue;
    if (v[i].size() % i != 0) bad = 1;
    int d = 0;
    for (auto x : v[i]) {
      if (d++ % i == 0) ++c;
      ans[x] = c;
    }
  }
  if (c > n) bad = 1;
  if (bad == 1)
    cout << "Impossible\n";
  else {
    cout << "Possible\n";
    for (int i = int(1); i <= int(n); ++i) cout << ans[i] << " ";
    cout << "\n";
  }
  return 0;
}
