#include <bits/stdc++.h>
using namespace std;
int a[100100];
int ans[100100];
vector<int> g[100100];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    g[a[i]].push_back(i);
  }
  int col = 1;
  bool isb = true;
  for (int i = 0; i <= n; i++) {
    while (g[i].size() != 0) {
      int m = g[i].size();
      int j = g[i][m - 1];
      g[i].pop_back();
      ans[j] = col;
      int z = n - i - 1;
      while (z > 0 && g[i].size() > 0) {
        ans[g[i].back()] = col;
        g[i].pop_back();
        z--;
      }
      if (z > 0) {
        isb = false;
        break;
      }
      col++;
    }
    if (!isb) {
      break;
    }
  }
  if (isb) {
    cout << "Possible\n";
    for (int i = 0; i < n; i++) {
      cout << ans[i] << " ";
    }
    cout << "\n";
  } else {
    cout << "Impossible\n";
  }
  return 0;
}
