#include using namespace std; const int maxn = 100005; int T, n, a[maxn], R[maxn]; vector ans; int main() { for (scanf("%d", &T); T--; ) { scanf("%d", &n); ans.clear(); for (int i = 1; i <= n; ++i) { scanf("%d", a + i); R[i] = i + 1; } int cur = n - 1; while (cur > 0) { if (R[cur] > n) { --cur; continue; } int v1 = a[cur], v2 = a[R[cur]]; if (v1 == v2 && v1 != 0) { ans.push_back(R[cur] - 1); R[cur] = R[R[cur]]; --a[cur]; } else --cur; } if ((int)ans.size() == n - 1 && a[1] == 0) { puts("Possible"); for (int i = n - 2; i >= 0; --i) printf("%d%c", ans[i], " \n"[i == 0]); } else { puts("Impossible"); } } return 0; }