#include <bits/stdc++.h>
using namespace std;
int n, arr[100005];
stack<int> ans[100005];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++)
      while (!ans[i].empty()) ans[i].pop();
    map<int, int> mp;
    mp.clear();
    for (int i = 0; i < n; i++) {
      scanf("%d", &arr[i]);
      if (!mp.count(arr[i]))
        mp[arr[i]] = 1;
      else
        mp[arr[i]]++;
    }
    map<int, int>::iterator it;
    bool OK = 1;
    int c = 1;
    for (it = mp.begin(); it != mp.end(); it++) {
      int a = (*it).first, b = (*it).second;
      if (a + b != n) {
        int t = n - a;
        if (b % t == 0) {
          for (int i = 0; i < b / t; i++) {
            for (int j = 0; j < t; j++) ans[a].push(c);
            c++;
          }
        } else {
          OK = 0;
          break;
        }
      } else {
        while (b--) ans[a].push(c);
        c++;
      }
    }
    if (OK) {
      printf("Possible\n");
      for (int i = 0; i < n; i++) {
        printf("%d ", ans[arr[i]].top());
        ans[arr[i]].pop();
      }
      printf("\n");
    } else
      printf("Impossible\n");
  }
  return 0;
}
