#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long arr[n];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  map<long long, long long> mp;
  long long diff = 0;
  for (long long i = 0; i < n; i++) {
    if (mp[n - arr[i]] == 0) {
      diff += n - arr[i];
      mp[n - arr[i]]++;
    } else if (mp[n - arr[i]] == n - arr[i]) {
      diff += n - arr[i];
      mp[n - arr[i]] = 1;
    } else {
      mp[n - arr[i]]++;
    }
    if (diff > n) {
      cout << "Impossible";
      return 0;
    }
  }
  cout << "Possible"
       << "\n";
  long long p = 0;
  map<long long, long long> id, freq;
  for (long long i = 0; i < n; i++) {
    if (freq[n - arr[i]] == 0) {
      p++;
      id[n - arr[i]] = p;
      freq[n - arr[i]]++;
      cout << p << " ";
    } else if (freq[n - arr[i]] == n - arr[i]) {
      p++;
      freq[n - arr[i]] = 1;
      id[n - arr[i]] = p;
      cout << p << " ";
    } else {
      freq[n - arr[i]]++;
      cout << id[n - arr[i]] << " ";
    }
  }
}
