#include <bits/stdc++.h>
using namespace std;
long long mod(long long a, long long b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  cin >> n;
  long long arr[n + 5];
  vector<pair<long long, long long>> vec;
  long long ctr[n + 5];
  memset(ctr, 0, sizeof(ctr));
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    vec.push_back({arr[i], i});
    ctr[arr[i]]++;
  }
  sort(vec.begin(), vec.end());
  for (auto it : vec) {
    if (ctr[it.first] % (n - it.first)) {
      cout << "Impossible";
      return 0;
    }
  }
  vector<long long> vec1;
  for (auto it : vec) vec1.push_back(it.first);
  long long st = 0;
  long long cur = n - vec[0].first;
  long long num = 1;
  long long cnt = 0;
  long long ans[n + 5];
  while (st < n) {
    while (cnt < cur) {
      ans[vec[st].second] = num;
      cnt++;
      st++;
    }
    if (st == n) break;
    num++;
    cnt = 0;
    cur = n - vec[st].first;
  }
  cout << "Possible\n";
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
}
