#include <bits/stdc++.h>
using namespace std;
int cnt[100005], cnt2[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  vector<int> b, ans;
  vector<pair<int, int> > a;
  cin >> n;
  a.resize(n);
  b.resize(n);
  ans.resize(n);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    cnt[x]++;
    a[i] = make_pair(x, i);
    b[i] = x;
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < n - 1; i++)
    if (cnt[i] > 0) {
      cnt[i] = 0;
    }
  int color = 0;
  for (int i = 0; i < n; i++) {
    if (i == 0 || a[i].first != a[i - 1].first || a[i].first == n - 1) {
      color++;
    } else {
      if (cnt[a[i].first] == n - a[i].first) {
        cnt[a[i].first] = 0;
        color++;
      }
    }
    ans[a[i].second] = color;
    cnt[a[i].first]++;
  }
  for (int i = 0; i < n; i++) cnt2[ans[i]]++;
  for (int i = 0; i < n; i++) {
    if (b[i] != n - cnt2[ans[i]]) {
      cout << "Impossible";
      return 0;
    }
  }
  cout << "Possible\n";
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
