#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int n;
pair<int, int> v[N];
int sol[N], cnt;
bool aresol;
void solve(int i) {
  if (i > n) return;
  int raman_egale = n - v[i].first;
  if (i + raman_egale - 1 > n) {
    aresol = 0;
    return;
  }
  cnt++;
  for (int j = i; j <= i + raman_egale - 1; j++) {
    sol[v[j].second] = cnt;
    if (v[j].first != v[i].first) aresol = 0;
  }
  solve(i + raman_egale);
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> v[i].first, v[i].second = i;
  sort(v + 1, v + n + 1);
  aresol = 1;
  solve(1);
  if (!aresol) {
    cout << "Impossible";
    return 0;
  }
  cout << "Possible\n";
  for (int i = 1; i <= n; ++i) cout << sol[i] << ' ';
}
