#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n];
  map<int, int> lol;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    a[i] = n - a[i];
    lol[a[i]]++;
  }
  for (int i = 0; i < n; ++i) {
    if (lol[a[i]] % a[i] != 0) {
      cout << "Impossible";
      return 0;
    }
  }
  int kol = 0;
  vector<int> ans(n, -1);
  map<int, int> CCCP;
  for (int i = 0; i < n; ++i) {
    if (lol[a[i]] % a[i] == 0) {
      kol++;
      CCCP[a[i]] = kol;
    }
    ans[i] = CCCP[a[i]];
    lol[a[i]]--;
  }
  cout << "Possible" << '\n';
  for (int i = 0; i < n; ++i) {
    cout << ans[i] << " ";
  }
  return 0;
}
