#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-O2")
const int MX = 15000000, LM = 3e5;
const int m_size = 100001;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[m_size], cnt[m_size], color[m_size], b[m_size];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] = n - 1 - a[i];
  }
  int nxt_color = 1;
  for (int i = 0; i < n; i++) {
    if (cnt[a[i]] == 0) {
      color[a[i]] = nxt_color++;
    }
    b[i] = color[a[i]];
    ++cnt[a[i]];
    if (cnt[a[i]] == a[i] + 1) {
      cnt[a[i]] = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (cnt[i]) {
      cout << "Impossible\n";
      return 0;
    }
  }
  cout << "Possible\n";
  for (int i = 0; i < n; i++) {
    cout << b[i] << " ";
  }
  cout << endl;
  return 0;
}
