#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589;
template <class T>
void dbs(string str, T t) {
  cerr << str << " : " << t << "\n";
}
template <class T, class... S>
void dbs(string str, T t, S... s) {
  long long idx = str.find(',');
  cerr << str.substr(0, idx) << " : " << t << ", ";
  dbs(str.substr(idx + 1), s...);
}
template <class S, class T>
ostream& operator<<(ostream& os, const pair<S, T>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class S, class T>
ostream& operator<<(ostream& os, const map<S, T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
void prc(T a, T b) {
  cerr << "[";
  for (T i = a; i != b; ++i) {
    if (i != a) cerr << ", ";
    cerr << *i;
  }
  cerr << "]\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  map<long long, long long> m, tot;
  long long curr = 1;
  vector<long long> ans(n);
  for (long long i = 0; i < n; i++) {
    if (m.find(v[i]) == m.end()) {
      ans[i] = curr;
      tot[curr] = n - v[i] - 1;
      m[v[i]] = curr;
      curr++;
    } else {
      if (tot[m[v[i]]] == 0) dbs("i, v[i]", i, v[i]);
      tot[m[v[i]]]--;
      ans[i] = m[v[i]];
    }
    if (tot[m[v[i]]] == 0) {
      m.erase(v[i]);
    }
  }
  bool check = true;
  for (auto i : tot) {
    if (i.second) {
      check = false;
      break;
    }
  }
  if (check) {
    cout << "Possible\n";
    for (long long i = 0; i < n; i++) cout << ans[i] << " ";
    cout << "\n";
  } else
    cout << "Impossible\n";
  return 0;
}
