#include <bits/stdc++.h>
using namespace std;
struct Person {
  int a;
  int id;
};
bool operator<(Person a, Person b) { return a.a < b.a; }
class TSolver {
 public:
  int n;
  vector<Person> persons;
  explicit TSolver(std::istream& in) {
    in >> n;
    persons.resize(n);
    for (int i = 0; i < n; ++i) {
      in >> persons[i].a;
      persons[i].id = i;
    }
  }
  bool ok = true;
  vector<int> ans;
  void Solve() {
    sort((persons).begin(), (persons).end());
    ans.resize(n);
    int color = 1;
    for (int i = 0; ok && i < n;) {
      int same = n - persons[i].a;
      ok = ok && i + same <= n;
      for (int j = 0; ok && j < same; ++j) {
        if (persons[i + j].a != persons[i].a) {
          ok = false;
        }
        ans[persons[i + j].id] = color;
      }
      i += same;
      ++color;
    }
  }
  void PrintAnswer(std::ostream& out) const {
    if (ok) {
      out << "Possible\n";
      for (int i = 0; i < n; ++i) {
        out << ans[i] << " \n"[i + 1 == n];
      }
    } else {
      out << "Impossible\n";
    }
  }
};
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  {
    auto solver = std::make_shared<TSolver>(std::cin);
    solver->Solve();
    solver->PrintAnswer(std::cout);
  }
  do {
  } while (false);
  return 0;
}
