AtCoder Grand Contest 002 - Knot Puzzle

We have N pieces of ropes, numbered 1 through N. The length of piece i is a_i.

At first, for each i (1≤i≤N-1), piece i and piece i+1 are tied at the ends, forming one long rope with N-1 knots. Snuke will try to untie all of the knots by performing the following operation repeatedly:

* Choose a (connected) rope with a total length of at least L, then untie one of its knots.



Is it possible to untie all of the N-1 knots by properly applying this operation? If the answer is positive, find one possible order to untie the knots.

Constraints

* 2≤N≤10^5
* 1≤L≤10^9
* 1≤a_i≤10^9
* All input values are integers.

Input

The input is given from Standard Input in the following format:


N L
a_1 a_2 ... a_n


Output

If it is not possible to untie all of the N-1 knots, print `Impossible`.

If it is possible to untie all of the knots, print `Possible`, then print another N-1 lines that describe a possible order to untie the knots. The j-th of those N-1 lines should contain the index of the knot that is untied in the j-th operation. Here, the index of the knot connecting piece i and piece i+1 is i.

If there is more than one solution, output any.

Examples

Input

3 50
30 20 10


Output

Possible
2
1


Input

2 21
10 10


Output

Impossible


Input

5 50
10 20 30 40 50


Output

Possible
1
2
3
4

Source: atcoder | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
(N, L) = map(int, input().split())
a = [int(x) for x in input().split()]
ans = False
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		ans = True
		break
if ans:
	print('Possible')
	for j in range(i):
		print(j + 1)
	for j in range(N - 2, i - 1, -1):
		print(j + 1)
else:
	print('Impossible')


(N, L) = [int(_) for _ in input().split()]
A = [int(_) for _ in input().split()]
(l, i) = max(((A[i] + A[i - 1], i) for i in range(1, N)))
ans = []
if l >= L:
	print('Possible')
	if i < N - 1:
		ans += list(range(N - 1, i, -1))
		ans += list(range(1, i + 1))
	else:
		ans += list(range(1, i + 1))
	print(*ans, sep='\n')
else:
	print('Impossible')


(N, L) = map(int, input().split())
l = list(map(int, input().split()))
judge = 'Impossible'
index = 0
for i in range(N - 1):
	if l[i] + l[i + 1] >= L:
		judge = 'Possible'
		index = i
		break
print(judge)
if judge == 'Impossible':
	exit()
for i in range(0, index):
	print(i + 1)
for i in range(index + 2, N)[::-1]:
	print(i)
print(index + 1)


(n, l) = [int(v) for v in input().split()]
a_s = [int(v) for v in input().split()]
piv = -1
b_s = []
for i in range(n - 1):
	a2 = a_s[i] + a_s[i + 1]
	b_s.append(a2)
	if a2 >= l:
		piv = i
if piv == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(piv):
		print(i + 1)
	for i in range(n - 2, piv - 1, -1):
		print(i + 1)


from collections import deque
(N, L) = map(int, input().split())
c = list(map(int, input().split()))
for i in range(len(c) - 1):
	if c[i] + c[i + 1] >= L:
		pos = i + 1
		break
else:
	print('Impossible')
	exit()
print('Possible')
for i in range(1, pos):
	print(i)
for i in range(len(c) - 1, pos, -1):
	print(i)
print(pos)


(n, l) = map(int, input().split())
As = list(map(int, input().split()))
ss = [As[i] + As[i + 1] for i in range(n - 1)]
cnt = 0
for (i, s) in enumerate(ss):
	if s >= l:
		cnt = i + 1
if cnt == 0:
	print('Impossible')
	exit()
print('Possible')
for i in range(1, cnt):
	print(i)
for i in range(n - 1, cnt, -1):
	print(i)
print(cnt)


(n, l) = map(int, input().split())
alist = list(map(int, input().split()))
preva = alist[0]
is_possible = False
for (i, a) in enumerate(alist[1:]):
	if preva + a >= l:
		is_possible = True
		break
	preva = a
if not is_possible:
	print('Impossible')
else:
	print('Possible')
	for j in range(1, i + 1):
		print(j)
	for j in range(n - 1, i + 1, -1):
		print(j)
	print(i + 1)


(n, L) = map(int, input().split())
a = list(map(int, input().split()))
st = -1
for i in range(n - 1):
	if a[i] + a[i + 1] >= L:
		st = i
		break
if st < 0:
	print('Impossible')
else:
	print('Possible')
	for i in range(st):
		print(i + 1)
	for i in range(n - 2, st, -1):
		print(i + 1)
	print(st + 1)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
flag = False
for i in range(0, n - 1):
	if not flag:
		if a[i] + a[i + 1] >= l:
			cnt = i + 1
			flag = True
if not flag:
	print('Impossible')
	exit()
ans = [cnt]
for i in range(cnt - 1, 0, -1):
	ans.append(i)
for i in range(cnt + 1, n):
	ans.append(i)
ans = ans[::-1]
print('Possible')
for i in range(len(ans)):
	print(ans[i])


(n, l) = map(int, input().split())
a = [0] + list(map(int, input().split()))
ll = None
for i in range(1, n):
	if a[i] + a[i + 1] >= l:
		ll = i
		break
if not ll:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, ll):
		print(i)
	for i in range(n - 1, ll, -1):
		print(i)
	print(ll)


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
x = N
for i in range(1, N):
	if a[i] + a[i - 1] >= L:
		x = i
if x == N:
	print('Impossible')
	exit()
print('Possible')
for i in range(1, x):
	print(i)
for i in range(N - 1, x - 1, -1):
	print(i)


(N, L) = map(int, input().split())
(*A,) = map(int, input().split())
S = [0] * (N + 1)
for (i, a) in enumerate(A):
	S[i + 1] = S[i] + a
ans = []
i = 0
j = N - 1
while i < j:
	if S[j + 1] - S[i] < L:
		print('Impossible')
		break
	if A[i] + A[i + 1] <= A[j] + A[j - 1]:
		ans.append(i + 1)
		i += 1
	else:
		ans.append(j)
		j -= 1
else:
	print('Possible')
	for a in ans:
		print(a)


import sys
input = sys.stdin.readline
inf = float('inf')
(n, L) = map(int, input().split())
a = tuple(map(int, input().split()))
for i in range(1, n):
	if a[i] + a[i - 1] >= L:
		print('Possible')
		for j in range(1, i):
			print(j)
		for j in range(n - 1, i, -1):
			print(j)
		print(i)
		exit()
print('Impossible')


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
sum_A = sum(A)
junban = []
flg = False
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		tmp = i
		flg = True
if flg:
	print('Possible')
	for i in range(N - 1):
		if tmp > i:
			print(i + 1)
		else:
			print(N + tmp - i - 1)
else:
	print('Impossible')


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
pre = A[0]
index = -1
for i in range(1, N):
	if pre + A[i] >= L:
		index = i
		break
	pre = A[i]
if index == -1:
	print('Impossible')
else:
	print('Possible')
	i = 1
	while i < index:
		print(i)
		i += 1
	i = N - 1
	while index - 1 < i:
		print(i)
		i -= 1


(N, L) = map(int, input().split())
(*A,) = map(int, input().split())
for (i, (a1, a2)) in enumerate(zip(A, A[1:])):
	if a1 + a2 >= L:
		print('Possible')
		print(*[j + 1 for j in range(i)] + [j + 1 for j in range(N - 2, i, -1)] + [i + 1], sep='\n')
		break
else:
	print('Impossible')


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
f = 0
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		f = 1
		t = i
		break
if f == 0:
	print('Impossible')
else:
	print('Possible')
	ans = []
	for i in range(t):
		ans.append(i + 1)
	for i in range(N - 1, t, -1):
		ans.append(i)
	for x in ans:
		print(str(x))


import sys
(N, L) = map(int, input().split())
A = [int(i) for i in input().split()]
s = 10 ** 23
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		s = i
		break
if s == 10 ** 23:
	print('Impossible')
	sys.exit()
print('Possible')
L = []
for i in range(s):
	L.append(i + 1)
for i in range(N - 2, s, -1):
	L.append(i + 1)
L.append(s + 1)
print('\n'.join(map(str, L)))


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
aa_max = -1
aa_i = -1
for i in range(N - 1):
	if a[i] + a[i + 1] > aa_max:
		aa_max = a[i] + a[i + 1]
		aa_i = i
if aa_max < L:
	print('Impossible')
else:
	print('Possible')
	for i in range(aa_i):
		print(i + 1)
	for i in range(N - 2, aa_i - 1, -1):
		print(i + 1)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
for i in range(1, N):
	if A[i - 1] + A[i] >= L:
		X = i
		break
else:
	print('Impossible')
	exit()
ans = []
for i in range(1, X):
	ans.append(i)
for i in range(N - 1, X, -1):
	ans.append(i)
ans.append(X)
print('Possible')
print(*ans, sep='\n')


import sys
(n, x) = map(int, input().split())
a = list(map(int, input().split()))
k = -1
for i in range(n - 1):
	if a[i] + a[i + 1] >= x:
		k = i
		break
	if i == n - 2:
		print('Impossible')
		sys.exit()
print('Possible')
for i in range(k):
	print(i + 1)
for i in range(n - 2, k, -1):
	print(i + 1)
print(k + 1)


ai = lambda : list(map(int, input().split()))
(n, l) = ai()
a = ai()
f = 0
for i in range(1, n):
	if a[i - 1] + a[i] >= l:
		f = 1
		key = i
		break
if f:
	print('Possible')
	b = list(range(n))
	c = b[1:key]
	c += b[-1:key:-1]
	c += [key]
	print(*c, sep='\n')
else:
	print('Impossible')


(n, l) = [int(x) for x in input().split()]
x = [int(x) for x in input().split()]
c = -1
for i in range(n - 1):
	if x[i] + x[i + 1] >= l:
		c = i
		break
if c == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, c + 1):
		print(i)
	for i in range(1, n - c):
		print(n - i)


(N, L) = list(map(int, input().split()))
A = list(map(int, input().split()))

def find():
	for i in range(N - 1):
		if A[i] + A[i + 1] >= L:
			return i
	return False
n = find()
if n is False:
	print('Impossible')
	exit(0)
n += 1
print('Possible')
for i in range(1, n):
	print(i)
for i in range(N - 1, n, -1):
	print(i)
print(n)


(N, L) = map(int, input().split())
As = list(map(int, input().split()))
for iKnot in range(1, N):
	if As[iKnot - 1] + As[iKnot] >= L:
		print('Possible')
		for i in range(1, iKnot):
			print(i)
		for i in reversed(range(iKnot + 1, N)):
			print(i)
		print(iKnot)
		break
else:
	print('Impossible')


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
sum = [0] * (N - 1)
for i in range(N - 1):
	sum[i] = a[i] + a[i + 1]
if max(sum) < L:
	print('Impossible')
else:
	print('Possible')
	id = sum.index(max(sum))
	for i in range(id):
		print(i + 1)
	for i in reversed(range(id + 1, N - 1)):
		print(i + 1)
	print(id + 1)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
failflag = 1
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		failflag = 0
		k = i
		break
if failflag == 1:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, k + 1):
		print(i)
	for i in range(n - 1 - k):
		print(n - 1 - i)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
B = [A[i - 1] + A[i] for i in range(1, N)]
if max(B) < L:
	print('Impossible')
else:
	print('Possible')
	ind = B.index(max(B))
	for i in range(ind):
		print(i + 1)
	for i in range(N - 1, ind, -1):
		print(i)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
last = -1
for (i, (a, b)) in enumerate(zip(A, A[1:])):
	if a + b >= L:
		last = i
		break
if last < 0:
	print('Impossible')
	exit()
print('Possible')
ans = list(range(1, i + 1)) + list(range(N - 1, i, -1))
print(*ans, sep='\n')


from collections import deque
(n, l) = map(int, input().split())
a = list(map(int, input().split()))
s = ''
for i in range(1, n):
	if a[i - 1] + a[i] >= l:
		s = 'p'
		break
if s == '':
	print('Impossible')
	exit()
print('Possible')
for j in range(1, i):
	print(j)
for j in range(1, len(a) - i):
	print(len(a) - j)
print(i)


(n, L, *a) = map(int, open(0).read().split())
cant = 0
for i in range(n - 1):
	if a[i] + a[i + 1] >= L:
		(l, r) = (i, i + 1)
		break
else:
	cant = 1
if cant:
	print('Impossible')
else:
	print('Possible')
	for i in range(l):
		print(i + 1)
	for i in range(n - 2, l - 1, -1):
		print(i + 1)


def main():
	(N, L) = [int(n) for n in input().split()]
	A = [int(n) for n in input().split()]
	flg = False
	for i in range(N - 1):
		if A[i] + A[i + 1] >= L:
			flg = True
			break
	if not flg:
		print('Impossible')
		return
	print('Possible')
	for j in range(1, i + 1):
		print(j)
	for j in reversed(range(i + 2, N)):
		print(j)
	print(i + 1)
main()


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		print('Possible')
		ans = list(range(1, i + 1)) + list(range(i + 2, n))[::-1]
		ans.append(i + 1)
		for i in ans:
			print(i)
		exit()
print('Impossible')


import sys
(N, L) = map(int, input().split())
a = list(map(int, input().split()))
last = -1
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		last = i
		break
if last == -1:
	print('Impossible')
	sys.exit()
print('Possible')
for i in range(last):
	print(i + 1)
for i in range(N - 1, last, -1):
	print(i)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(1, n):
	if a[i] + a[i - 1] >= l:
		print('Possible')
		for j in range(1, i):
			print(j)
		for j in range(n - 1, i, -1):
			print(j)
		print(i)
		break
else:
	print('Impossible')


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
flag = False
while i < N - 1:
	if a[i] + a[i + 1] >= L:
		flag = True
		break
	i += 1
if not flag:
	print('Impossible')
else:
	print('Possible')
	for j in range(i):
		print(j + 1)
	for j in range(N - 1, i, -1):
		print(j)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
ok = False
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		ok = True
		idx = i
if ok:
	print('Possible')
	for i in range(1, idx + 1):
		print(i)
	for i in reversed(range(idx + 2, n)):
		print(i)
	print(idx + 1)
else:
	print('Impossible')


import sys
input = sys.stdin.readline
(N, L) = map(int, input().split())
a = list(map(int, input().split()))
res = []
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		res.append(i)
		break
else:
	print('Impossible')
	exit(0)
for i in range(res[0] - 1, -1, -1):
	res.append(i)
for i in range(res[0] + 1, N - 1):
	res.append(i)
res.reverse()
print('Possible')
for r in res:
	print(r + 1)


(N, L) = list(map(int, input().split()))
a = list(map(int, input().split()))
judge = 'Impossible'
for i in range(N - 1):
	x = a[i] + a[i + 1]
	if x >= L:
		judge = 'Possible'
		c = i + 1
		break
if judge == 'Impossible':
	print(judge)
else:
	print(judge)
	for i in range(1, c):
		print(i)
	for i in range(N - c - 1):
		print(N - 1 - i)
	print(c)


def inpl():
	return [int(i) for i in input().split()]
import sys
(N, L) = inpl()
a = inpl()
b = []
for i in range(N - 1):
	b.append(a[i] + a[i + 1])
bmax = max(b)
if bmax < L:
	print('Impossible')
	sys.exit()
print('Possible')
ans = b.index(bmax)
Ans = list(range(0, ans)) + list(range(N - 2, ans, -1)) + [ans]
for i in range(N - 1):
	print(Ans[i] + 1)


(n, l, *a) = map(int, open(0).read().split())
i = m = 0
for (j, (x, y)) in enumerate(zip(a, a[1:]), 1):
	if x + y > m:
		m = x + y
		i = j
if m < l:
	print('Impossible')
else:
	print('Possible')
	print(*range(1, i))
	print(*range(n - 1, i, -1))
	print(i)


def main():
	(N, L) = map(int, input().split())
	A = list(map(int, input().split()))
	for i in range(1, N):
		if A[i - 1] + A[i] >= L:
			print('Possible')
			for j in range(1, i):
				print(j)
			for j in range(N - 1, i - 1, -1):
				print(j)
			return
	print('Impossible')
main()


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
flag = False
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		flag = True
		idx = i + 1
		break
if not flag:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, idx):
		print(i)
	for i in range(N - 1, idx, -1):
		print(i)
	print(idx)


import sys
import os
(N, L, *A) = map(int, os.read(0, 10 ** 8).split())

def main(L, A):
	N = len(A)
	is_long = [x + y >= L for (x, y) in zip(A, A[1:])]
	if not any(is_long):
		print('Impossible')
		return
	print('Possible')
	i = is_long.index(True)
	nums = list(range(1, i + 1)) + list(range(N - 1, i, -1))
	print(*nums, sep='\n')
main(L, A)


(n, l) = [int(v) for v in input().split()]
knot_list = [int(v) for v in input().split()]
pos = 0
for i in range(1, n):
	if knot_list[i - 1] + knot_list[i] >= l:
		pos = i
		break
if pos == 0:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, pos):
		print(i)
	for i in range(n - 1, pos - 1, -1):
		print(i)


def s():
	(n, l, *a) = map(int, open(0).read().split())
	for (i, (x, y)) in enumerate(zip(a, a[1:])):
		if x + y >= l:
			print('Possible')
			r = list(range(n))
			print('\n'.join(map(str, r[1:i + 1] + r[n:i:-1])))
			break
	else:
		print('Impossible')
s()


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
x = 0
for i in range(N - 1):
	d = A[i] + A[i + 1]
	if d >= L:
		x = 1
		knot = i + 1
		break
if x == 0:
	print('Impossible')
	exit()
print('Possible')
for i in range(1, knot):
	print(i)
for i in range(N - 1, knot - 1, -1):
	print(i)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
flg = False
ans = []
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		ans = [j for j in range(1, i + 1)] + [j for j in range(n - 1, i + 1, -1)] + [i + 1]
		flg = True
		break
if flg:
	print('Possible')
	print(*ans, sep='\n')
else:
	print('Impossible')


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
mu = [0] * (n - 1)
for i in range(n - 1):
	mu[i] = a[i] + a[i + 1]
if max(mu) < l:
	print('Impossible')
else:
	print('Possible')
	s = mu.index(max(mu))
	for i in range(1, s + 1):
		print(i)
	for i in range(n - 1, s, -1):
		print(i)


(N, L) = map(int, input().split())
lists = list(map(int, input().split()))
flag = False
J = 0
for i in range(N - 1):
	if lists[i] + lists[i + 1] >= L:
		J = i + 1
		flag = True
		break
if not flag:
	print('Impossible')
if flag:
	print('Possible')
	for i in range(100001, 0, -1):
		if 1 <= J - i <= N - 1:
			print(J - i)
		if 1 <= J + i <= N - 1:
			print(J + i)
	print(J)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
for (i, (a, b)) in enumerate(zip(A, A[1:])):
	if a + b >= L:
		print('Possible')
		break
else:
	print('Impossible')
	exit()
ans = []
for j in range(1, i + 1):
	ans.append(j)
for j in range(N - 1, i + 1, -1):
	ans.append(j)
ans.append(i + 1)
print(*ans, sep='\n')


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
idx = -1
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		idx = i
		break
if idx == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(idx):
		print(i + 1)
	for i in range(N - 1, idx, -1):
		print(i)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
X = [A[i] + A[i + 1] for i in range(N - 1)]
if any(map(lambda x: x >= L, X)):
	print('Possible')
	for (i, x) in enumerate(X, start=1):
		if x >= L:
			xi = i
			break
	for i in range(1, xi):
		print(i)
	for i in reversed(range(xi + 1, N)):
		print(i)
	print(xi)
else:
	print('Impossible')


(n, l) = map(int, input().split())
t = list(map(int, input().split()))
for i in range(n - 1):
	if t[i] + t[i + 1] >= l:
		print('Possible')
		print(*list(range(1, i + 1)) + list(range(n - 1, i + 1, -1)), sep='\n')
		print(i + 1)
		exit()
print('Impossible')


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
b = [a[i] + a[i + 1] for i in range(n - 1)]
start = -1
for (ind, length) in enumerate(b):
	if length >= l:
		start = ind + 1
		break
if start < 0:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, start):
		print(i)
	for i in range(start, n)[::-1]:
		print(i)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
choose = -1
for i in range(1, N):
	if A[i - 1] + A[i] >= L:
		choose = i - 1
		break
if choose == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(0, choose):
		print(i + 1)
	for i in range(N - 1, choose + 1, -1):
		print(i)
	print(choose + 1)


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
longest = 0
longest_i = N
for i in range(N - 1):
	knot = a[i] + a[i + 1]
	if knot > longest:
		longest = knot
		longest_i = i + 1
if longest < L:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, longest_i):
		print(i)
	for j in range(N - 1, longest_i - 1, -1):
		print(j)


(N, L) = map(int, input().split())
As = list(map(int, input().split()))
i = 0
for j in range(1, N):
	if As[j - 1] + As[j] >= L:
		i = j
		break
if i == 0:
	print('Impossible')
else:
	print('Possible')
	for j in range(1, i):
		print(j)
	for j in range(N - 1, i, -1):
		print(j)
	print(i)


from itertools import accumulate as ac
(n, l) = map(int, input().split())
(*a,) = map(int, input().split())
v = []
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		v.append(i + 1)
		break
else:
	print('Impossible')
if v:
	st = v[0]
	v += list(range(1, st)[::-1])
	v += list(range(st + 1, n))
	print('Possible')
	for i in v[::-1]:
		print(i)


(n, L) = map(int, input().split())
a = list(map(int, input().split()))
r = [0]
for i in range(n):
	r.append(r[i] + a[i])
ansl = []
(p, q) = (0, n - 1)
suma = sum(a)
while p < q:
	if r[q + 1] - r[p] < L:
		print('Impossible')
		exit()
	if a[p] + a[p + 1] <= a[q - 1] + a[q]:
		ansl.append(p + 1)
		p += 1
	else:
		ansl.append(q)
		q -= 1
print('Possible')
for ans in ansl:
	print(ans)


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
t = True
key_number = -1
for i in range(1, N):
	if a[i] + a[i - 1] >= L:
		t = False
		key_number = i
if t:
	print('Impossible')
else:
	print('Possible')
	for ans in range(1, key_number):
		print(ans)
	for ans in range(N - 1, key_number - 1, -1):
		print(ans)


import sys
(N, L) = map(int, sys.stdin.readline().rstrip().split())
A = list(map(int, sys.stdin.readline().rstrip().split()))
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		print('Possible')
		for j in range(1, i + 1):
			print(j)
		for j in range(i + 1, N)[::-1]:
			print(j)
		sys.exit()
print('Impossible')


(N, L) = map(int, input().split())
A = [int(a) for a in input().split()]
for i in range(1, N):
	if A[i - 1] + A[i] >= L:
		print('Possible')
		for j in range(1, i):
			print(j)
		for j in range(N - 1, i, -1):
			print(j)
		print(i)
		break
else:
	print('Impossible')


(n, l) = map(int, input().split())
A = list(map(int, input().split()))
add = 0
for i in range(1, n):
	if A[i] + A[i - 1] >= l:
		add = i + 1
		break
if add == 0:
	print('Impossible')
	exit()
print('Possible')
for i in range(1, add - 1):
	print(i)
for i in [j for j in range(add, n)][::-1]:
	print(i)
print(add - 1)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
pos = -1
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		pos = i
		break
if pos == -1:
	print('Impossible')
	exit()
print('Possible')
for i in range(pos):
	print(i + 1)
for i in reversed(range(pos + 1, n - 1)):
	print(i + 1)
print(pos + 1)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
l = max_2 = A[0] + A[1]
idx = 0
for i in range(N - 2):
	l += A[i + 2] - A[i]
	if l > max_2:
		max_2 = l
		idx = i + 1
if max_2 < L:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, idx + 1):
		print(i)
	for i in range(N - 1, idx, -1):
		print(i)


(N, L) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
possible = 0
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		print('Possible')
		possible = i + 1
		break
if possible:
	for i in range(1, possible):
		print(i)
	for i in range(N - possible - 1):
		print(N - i - 1)
	print(possible)
else:
	print('Impossible')


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
A.insert(0, 0)
cmax = 0
ind = -1
for i in range(1, N):
	if A[i] + A[i + 1] > cmax:
		cmax = A[i] + A[i + 1]
		ind = i
if cmax >= L:
	print('Possible')
	for i in range(1, ind):
		print(i)
	for i in range(N - 1, ind - 1, -1):
		print(i)
else:
	print('Impossible')


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
f = True
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		print('Possible')
		print('\n'.join([str(j) for j in range(1, i + 1)] + [str(j) for j in range(n - 1, i + 1, -1)] + [str(i + 1)]))
		f = False
		break
if f:
	print('Impossible')


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
memo = -1
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		memo = i
if memo == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(memo):
		print(i + 1)
	for i in range(n - 2, memo - 1, -1):
		print(i + 1)


def N():
	return int(input())

def NM():
	return map(int, input().split())

def L():
	return list(NM())

def LN(n):
	return [N() for i in range(n)]

def LL(n):
	return [L() for i in range(n)]
(n, l) = NM()
a = [0] + L()
for i in range(1, n):
	if a[i] + a[i + 1] >= l:
		print('Possible')
		for j in range(1, i):
			print(j)
		for j in range(n - 1, i - 1, -1):
			print(j)
		break
else:
	print('Impossible')


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
untiable = False
lastknot = None
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		untiable = True
		lastknot = i + 1
		break
if untiable:
	ans = [i for i in range(1, lastknot)] + [i for i in range(lastknot + 1, N)[::-1]] + [lastknot]
	print('Possible')
	print('\n'.join(map(str, ans)))
else:
	print('Impossible')


def main():
	(N, L, *A) = map(int, open(0).read().split())
	L = [i for (i, (x, y)) in enumerate(zip(A, A[1:]), 1) if x + y >= L]
	if L:
		print('Possible')
		B = [i for i in range(L[0], N)] + [i for i in range(1, L[0])][::-1]
		print(*B[::-1], sep='\n')
	else:
		print('Impossible')
main()


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
renzoku_length = [0] * n
last_undo = -1
for i in range(1, n):
	renzoku_length[i] = a[i] + a[i - 1]
	if renzoku_length[i] >= l:
		last_undo = i
		break
if last_undo == -1:
	print('Impossible')
	exit()
print('Possible')
for i in range(1, last_undo):
	print(i)
for i in range(last_undo + 1, n)[::-1]:
	print(i)
print(last_undo)


(n, l) = map(int, input().split())
arr = list(map(int, input().split()))
pos = 0
tmp = 0
for i in range(n - 1):
	if arr[i] + arr[i + 1] > tmp:
		pos = i
		tmp = arr[i] + arr[i + 1]
if tmp < l:
	print('Impossible')
else:
	print('Possible')
	ans = []
	for i in range(pos):
		ans.append(i + 1)
	for i in range(n - 1, pos + 1, -1):
		ans.append(i)
	ans.append(pos + 1)
	for i in range(n - 1):
		print(ans[i])


from collections import deque

def solve():
	ans = ['Possible']
	(N, L) = map(int, input().split())
	A = list(map(int, input().split()))
	for i in range(N - 1):
		if A[i] + A[i + 1] >= L:
			ind = i
			break
	else:
		return ['Impossible']
	for i in range(1, ind + 1):
		ans.append(i)
	for i in range(N - 1, ind + 1, -1):
		ans.append(i)
	ans.append(ind + 1)
	return ans
print(*solve(), sep='\n')


import sys
(N, L) = map(int, input().split())
A = [int(_) for _ in input().split()]
for n in range(N - 1):
	if A[n] + A[n + 1] >= L:
		print('Possible')
		tmp_ind = n + 1
		for m in range(1, tmp_ind):
			print(m)
		for m in range(N - 1, tmp_ind, -1):
			print(m)
		print(tmp_ind)
		sys.exit()
print('Impossible')


import sys
(n, l) = map(int, input().split())
a = [int(x) for x in input().split()]
key = -1
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		key = i
		break
if key == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(key):
		print(i + 1)
	for i in range(n - 1, key, -1):
		print(i)


(N, L, *A) = map(int, open(0).read().split())
k = -1
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		k = i + 1
		break
if k == -1:
	print('Impossible')
else:
	print('Possible')
	for j in range(1, k):
		print(j)
	for j in reversed(range(k + 1, N)):
		print(j)
	print(k)


def resolve():
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	for i in range(n - 1):
		if a[i] + a[i + 1] >= l:
			print('Possible')
			for j in range(i):
				print(j + 1)
			for j in range(n - 1, i, -1):
				print(j)
			return 0
	print('Impossible')
resolve()


(n, l) = map(int, input().split())
r = list(map(int, input().split()))
o = 0
flag = 1
for i in range(1, n):
	lr = r[i - 1] + r[i]
	if lr >= l:
		o = i
		flag = 0
		break
if flag == 0:
	print('Possible')
	for j in range(1, o):
		print(j)
	for k in range(n - 1, o, -1):
		print(k)
	print(o)
else:
	print('Impossible')


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
ans = float('inf')
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		ans = i + 1
if ans == float('inf'):
	print('Impossible')
else:
	print('Possible')
	print(*range(1, ans), sep='\n')
	print(*range(n - 1, ans, -1), sep='\n')
	print(ans)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
if N == 2:
	if sum(A) >= L:
		print('Possible')
		print(1)
	else:
		print('Impossible')
	exit(0)
lasti = -1
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		lasti = i + 1
		break
if lasti == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, lasti):
		print(i)
	for i in range(N - 1, lasti - 1, -1):
		print(i)


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
sums = [a[i] + a[i + 1] for i in range(N - 1)]
(maxind, maxval) = max(enumerate(sums), key=lambda x: x[1])
if maxval >= L:
	print('Possible')
	for i in range(maxind):
		print(i + 1)
	for j in reversed(range(maxind, N - 1)):
		print(j + 1)
else:
	print('Impossible')


import sys
input = sys.stdin.readline
(n, l) = map(int, input().split())
a = list(map(int, input().split()))
x = -1
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		x = i
		break
if x == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(x):
		print(i + 1)
	for i in range(n - 2, x, -1):
		print(i + 1)
	print(x + 1)


from collections import deque
(n, l) = map(int, input().split())
a = list(map(int, input().split()))
last = -1
for i in range(1, n):
	if a[i - 1] + a[i] >= l:
		last = i
if last == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, last):
		print(i)
	for i in range(n - 1, last, -1):
		print(i)
	print(last)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
sumax = 0
for i in range(n - 1):
	if sumax < a[i] + a[i + 1]:
		sumax = a[i] + a[i + 1]
		ind = i
if sumax < l:
	print('Impossible')
	exit()
print('Possible')
for i in range(1, n):
	if i > ind:
		break
	print(i)
for i in reversed(range(n)):
	if i == ind:
		break
	print(i)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
rh = -1
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		rh = i
		break
else:
	print('Impossible')
	exit()
print('Possible')
if rh > 0:
	for i in range(rh):
		print(i + 1)
if rh + 1 < n:
	for i in range(n - 1, rh + 1, -1):
		print(i)
print(rh + 1)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		print('Possible')
		ans = [i + 1] + list(range(i, 0, -1)) + list(range(i + 2, n))
		print(*ans[::-1], sep='\n')
		break
else:
	print('Impossible')


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
for i in range(1, N):
	if A[i - 1] + A[i] >= L:
		X = i
		break
else:
	print('Impossible')
	exit()
print('Possible')
for i in range(1, X):
	print(i)
for i in range(N - 1, X - 1, -1):
	print(i)


import sys
import os
(N, L) = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		print('Possible')
		for j in range(i):
			print(j + 1)
		for j in range(N - 1, i, -1):
			print(j)
		sys.exit()
print('Impossible')


(n, l) = map(int, input().split())
A = [int(i) for i in input().split()]
(length, knot) = (A[0] + A[1], 1)
for i in range(n - 2):
	if A[i + 1] + A[i + 2] > length:
		length = A[i + 1] + A[i + 2]
		knot = i + 2
if length < l:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, knot):
		print(i)
	for i in range(knot, n):
		print(n + knot - i - 1)


(N, L) = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A2 = [x + A[ind + 1] for (ind, x) in enumerate(A[:-1])]
A2.index(max(A2))
if max(A2) < L:
	print('Impossible')
else:
	print('Possible')
	last = A2.index(max(A2))
	for i in range(last):
		print(i + 1)
	for i in range(N - 1, last + 1, -1):
		print(i)
	print(last + 1)


(n, l) = map(int, input().split())
a = [int(i) for i in input().split()]
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		print('Possible')
		for j in range(n - 1, i + 1, -1):
			print(j)
		for k in range(1, i + 2):
			print(k)
		exit()
print('Impossible')


(N, L) = map(int, input().split())
As = list(map(int, input().split()))
n = -1
for i in range(1, N):
	if As[i - 1] + As[i] >= L:
		n = i
		break
if n < 0:
	print('Impossible')
	exit()
print('Possible')
for i in range(n - 1):
	print(i + 1)
for i in reversed(range(n, N)):
	print(i)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
ans = 'Impossible'
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		ans = 'Possible'
		t = i
		break
if ans == 'Impossible':
	print(ans)
else:
	print(ans)
	for i in range(t):
		print(i + 1)
	for i in range(N - 2, t, -1):
		print(i + 1)
	print(t + 1)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
last = -1
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		last = i + 1
if last == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, last):
		print(i)
	for i in range(len(a) - 1, last - 1, -1):
		print(i)


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
end = 0
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		end = i + 1
		break
else:
	print('Impossible')
	exit()
ans = list(range(1, end)) + list(range(end, N))[::-1]
print('Possible')
print(*ans, sep='\n')


(n, l) = map(int, input().split())
al = list(map(int, input().split()))
target = -1
for i in range(n - 1):
	if al[i] + al[i + 1] >= l:
		target = i
if target == -1:
	print('Impossible')
	exit()
else:
	print('Possible')
	for i in range(target):
		print(i + 1)
	for i in range(n - 1, target + 1, -1):
		print(i)
	print(target + 1)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
x = -1
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		x = i
		break
if x == -1:
	print('Impossible')
else:
	print('Possible')
	r = list(range(1, x + 1)) + list(range(N - 1, x + 1, -1)) + [x + 1]
	print(*r, sep='\n')


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
flag = True
l = -1
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		l = i + 1
if l < 0:
	print('Impossible')
	exit()
knot = list(range(1, N))
print('Possible')
idx = 1
while idx < l:
	print(idx)
	idx += 1
idx = N - 1
while idx > l:
	print(idx)
	idx -= 1
print(l)


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(1, len(a)):
	if a[i] + a[i - 1] < L:
		pass
	else:
		print('Possible')
		for j in range(1, i):
			print(j)
		for k in range(len(a) - i - 1):
			print(len(a) - 1 - k)
		print(i)
		exit()
print('Impossible')


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
MAX = 0
MAX_i = 0
for i in range(n - 1):
	now = a[i] + a[i + 1]
	if now > MAX:
		MAX = now
		MAX_i = i
if MAX >= l:
	print('Possible')
	for i in range(MAX_i):
		print(i + 1)
	for i in range(n - MAX_i - 1):
		print(n - i - 1)
else:
	print('Impossible')


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
flag = -1
for i in range(n - 1):
	if l <= a[i] + a[i + 1]:
		flag = i + 1
if flag == -1:
	print('Impossible')
	exit()
print('Possible')
for i in range(1, flag):
	print(i)
for i in range(flag + 1, n)[::-1]:
	print(i)
print(flag)


(N, L) = map(int, input().split())
a_list = list(map(int, input().split()))

def equal_or_over_idx():
	for i in range(N - 1):
		if a_list[i] + a_list[i + 1] >= L:
			return i
	return -1
idx = equal_or_over_idx()
if idx == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(idx):
		print(i + 1)
	for i in range(N - 1, idx, -1):
		print(i)


K = 10 ** 10
import sys
(N, L) = map(int, input().split())
T = list(map(int, input().split()))
for i in range(N - 1):
	if T[i] + T[i + 1] >= L:
		K = i
		print('Possible')
		break
if K == 10 ** 10:
	print('Impossible')
	sys.exit()
K = K + 1
R = list(range(1, K))
M = list(range(K + 1, N))
M.reverse()
R.extend(M)
R.append(K)
for i in range(N - 1):
	print(R[i])


(n, l) = map(int, input().split())
L = list(map(int, input().split()))
flag = False
cur = 0
for i in range(n - 1):
	if L[i] + L[i + 1] >= l:
		flag = True
		cur = i + 1
		break
if flag:
	print('Possible')
	for i in range(1, cur):
		print(i)
	for i in range(n - 1, cur, -1):
		print(i)
	print(cur)
else:
	print('Impossible')


(n, l) = map(int, input().split())
A = list(map(int, input().split()))
for i in range(n - 1):
	if A[i] + A[i + 1] >= l:
		print('Possible')
		t = i + 1
		break
else:
	print('Impossible')
	exit()
for i in range(1, t):
	print(i)
for i in range(n - 1, t, -1):
	print(i)
print(t)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
m = 0
x = 0
for i in range(n - 1):
	if a[i] + a[i + 1] >= m:
		m = a[i] + a[i + 1]
		x = i
if m < l:
	print('Impossible')
else:
	print('Possible')
	for j in range(x):
		print(j + 1)
	for k in range(n - 1, x + 1, -1):
		print(k)
	print(x + 1)


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
max_value = max_value_index = 0
for (index, i) in enumerate(zip(a[:-1], a[1:])):
	if max_value < sum(i):
		max_value = sum(i)
		max_value_index = index
print('Possible\n' + '\n'.join([str(i) for i in range(1, max_value_index + 1)] + [str(i) for i in range(N - 1, max_value_index, -1)]) if max_value >= L else 'Impossible')


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n - 1):
	if a[i] + a[i + 1] >= k:
		print('Possible')
		x = i
		break
else:
	print('Impossible')
	exit()
if x == 0:
	print(*list(range(1, n))[::-1], sep='\n')
else:
	ans = list(range(1, n))
	ans[x:] = ans[n - 1:x - 1:-1]
	print(*ans, sep='\n')


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
check_min = 0
index_min = n
for i in range(n - 1):
	if check_min < a[i] + a[i + 1]:
		check_min = a[i] + a[i + 1]
		index_min = i
if check_min < l:
	print('Impossible')
else:
	print('Possible')
	for i in range(index_min):
		print(i + 1)
	for i in range(n - 2, index_min, -1):
		print(i + 1)
	print(index_min + 1)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
f = -1
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		f = i
		break
if f == -1:
	print('Impossible')
	exit()
print('Possible')
for i in range(n - 1):
	if i < f:
		print(i + 1)
	elif i > f:
		print(n - i + f)
print(f + 1)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
lastmusubi = -1
tmp = 0
for i in range(n - 1):
	if a[i] + a[i + 1] > tmp:
		lastmusubi = i
		tmp = a[i] + a[i + 1]
if tmp >= l:
	print('Possible')
	if lastmusubi > 0:
		for j in range(lastmusubi):
			print(j + 1)
	if lastmusubi < n - 1:
		for j in range(n - 2, lastmusubi, -1):
			print(j + 1)
	print(lastmusubi + 1)
else:
	print('Impossible')


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		print('Possible')
		break
else:
	print('Impossible')
	exit()
li = list(range(1, i + 1)) + list(range(n - 1, i + 1, -1)) + [i + 1]
for x in li:
	print(x)


(n, l, *a) = map(int, open(0).read().split())
i = 0
for (a, b) in zip(a, a[1:]):
	i += 1
	a + b >= l > exit(print('Possible', *range(1, i), *range(n - 1, i - 1, -1)))
print('Impossible')


(n, l) = map(int, input().split())
A = [int(i) for i in input().split()]
wa = [A[i] + A[i + 1] for i in range(n - 1)]
lim = max(wa)
knot = wa.index(lim)
go = False
if l <= lim:
	print('Possible')
	go = True
else:
	print('Impossible')
if go:
	for i in range(knot):
		print(i + 1)
	for i in range(n - knot - 2):
		print(n - i - 1)
	print(knot + 1)


(N, L) = map(int, input().split())
a = [int(c) for c in input().split()]
m = 10 ** 9
j = -1
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		print('Possible')
		for j in range(1, i + 1):
			print(j)
		for j in range(N - 1, i + 1, -1):
			print(j)
		print(i + 1)
		break
else:
	print('Impossible')


temp = input().split()
N = int(temp[0])
L = int(temp[1])
a = [int(i) for i in input().split()]
flag = False
ans = []
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		print('Possible')
		flag = True
		ans.append(i)
		break
else:
	print('Impossible')
if flag == True:
	while ans[-1] > 0:
		ans.append(ans[-1] - 1)
	if ans[0] < N - 1:
		ans.append(ans[0] + 1)
		while ans[-1] < N - 2:
			ans.append(ans[-1] + 1)
	for i in range(N - 2, -1, -1):
		print(ans[i] + 1)


(n, l) = map(int, input().split())
A = list(map(int, input().split()))
last = -1
for i in range(n - 1):
	if A[i] + A[i + 1] >= l:
		last = i
		break
if last == -1:
	print('Impossible')
else:
	print('Possible')
	for i in range(last):
		print(i + 1)
	for i in range(n - 2, last - 1, -1):
		print(i + 1)


import sys
(N, L) = map(int, input().split())
A = [int(i) for i in input().split()]
flag = True
a = -1
for i in range(N - 1):
	if A[i + 1] + A[i] >= L:
		flag = False
		a = i + 1
		break
if flag:
	print('Impossible')
	sys.exit()
print('Possible')
for i in range(1, a):
	print(i)
for i in range(N - 1, a, -1):
	print(i)
print(a)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
start = -1
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		start = i
if start < 0:
	print('Impossible')
	exit()
ans = [start + 1]
for i in range(start + 1, N - 1):
	ans.append(i + 1)
for i in reversed(range(start)):
	ans.append(i + 1)
ans.reverse()
print('Possible')
print(*ans, sep='\n')


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
b = 0
c = 0
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		print('Possible')
		b = 1
		c = i
		break
else:
	print('Impossible')
if b == 1:
	for i in range(1, c + 1):
		print(i)
	for i in range(N - 1, c, -1):
		print(i)


(N, L, *a) = map(int, open(0).read().split())
for (i, (n, m)) in enumerate(zip(a, a[1:]), 1):
	if n + m >= L:
		print('Possible')
		print('\n'.join((c for it in (range(1, i), range(N - 1, i, -1), [i]) for c in map(str, it))))
		break
else:
	print('Impossible')


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
idx = -1
for i in range(n - 1):
	if a[i] + a[i + 1] >= k:
		idx = i
		break
if idx == -1:
	print('Impossible')
	exit()
else:
	print('Possible')
	for i in range(1, idx + 1):
		print(i)
	for i in range(n - 1, idx, -1):
		print(i)


(N, L) = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
res = -1
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		res = i
		break
if res != -1:
	print('Possible')
	for i in range(res):
		print(i + 1)
	for i in range(N - 1, res, -1):
		print(i)
else:
	print('Impossible')


(n, l) = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
(s, x, y, ans, num, z) = (sum(a), 0, n - 1, [], 0, 0)
for i in range(n - 1):
	num2 = a[i] + a[i + 1]
	if num < num2:
		(num, z) = (num2, i + 1)
if num >= l:
	print('Possible')
	for i in range(1, z):
		print(i)
	for i in range(n - 1, z - 1, -1):
		print(i)
else:
	print('Impossible')


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
flg = False
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		flg = True
		break
if not flg:
	print('Impossible')
	exit()
else:
	print('Possible')
for j in range(i):
	print(j + 1)
for j in range(N - 1, i + 1, -1):
	print(j)
print(i + 1)


(n, l) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
index = 0
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		index = i + 1
if index == 0:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, index):
		print(i)
	for i in range(n - 1, index, -1):
		print(i)
	print(index)


def dump(n, k):
	for i in range(k - 1):
		print(i + 1)
	for i in range(n - 1, k - 1, -1):
		print(i)
(n, l) = map(int, input().split(' '))
a = input().split(' ')
a = [int(s) for s in a]
k = 0
for i in range(n - 1):
	if a[i] + a[i + 1] >= l:
		k = i + 1
		break
if k == 0:
	print('Impossible')
else:
	print('Possible')
	dump(n, k)


(n, l, *a) = map(int, open(0).read().split())
for (i, (x, y)) in enumerate(zip(a, a[1:])):
	if x + y >= l:
		print('Possible')
		r = list(range(n))
		print('\n'.join(map(str, r[1:i + 1] + r[n:i:-1])))
		exit()
print('Impossible')


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
I = [i + 1 for i in range(N - 1) if a[i] + a[i + 1] >= L]
ans = 'Possible\n{}'.format('\n'.join(map(str, list(range(1, I[0])) + list(range(N - 1, I[0], -1)) + [I[0]]))) if I else 'Impossible'
print(ans)


(N, L) = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
P = 'Possible'
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		start = i
		break
else:
	P = 'Impossible'
print(P)
if P == 'Possible':
	ans = [start]
	if start > 0:
		ans += reversed(list(range(start)))
	if start != N - 2:
		ans += list(range(start + 1, N - 1))
	ans.reverse()
	for a in ans:
		print(a + 1)


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
k = -1
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		k = i + 1
if k == -1:
	print('Impossible')
else:
	print('Possible')
	res = []
	for i in reversed(range(1, k + 1)):
		res.append(i)
	for i in range(k + 1, N):
		res.append(i)
	for i in reversed(res):
		print(i)


import sys
read = sys.stdin.read
readline = sys.stdin.readline
(N, L, *a) = map(int, read().split())
knot = -1
for (idx, (i, j)) in enumerate(zip(a, a[1:])):
	if i + j >= L:
		knot = idx + 1
		print('Possible')
		break
else:
	print('Impossible')
	exit()
answer = list(range(1, knot)) + list(range(knot + 1, N))[::-1] + [knot]
print('\n'.join(map(str, answer)))


(N, M) = map(int, input().split())
L = list(map(int, input().split()))
count = 0
vouch = 0
A = []
for i in range(0, N - 1):
	if count == 0:
		if L[i] + L[i + 1] >= M:
			count = 1
			A.append(N - 1)
		else:
			A.append(i + 1)
	else:
		A.append(N - 2 - vouch)
		vouch += 1
if count == 0:
	print('Impossible')
	exit()
else:
	print('Possible')
for i in range(0, N - 1):
	print(A[i])


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
for i in range(0, N - 1):
	if A[i] + A[i + 1] >= L:
		print('Possible')
		for j in range(1, i + 1):
			print(j)
		T = []
		for j in range(i + 2, N):
			T.append(j)
		T.sort(reverse=True)
		for j in range(0, len(T)):
			print(T[j])
		print(i + 1)
		break
else:
	print('Impossible')


(n, l, *a) = map(int, open(0).read().split())
ans = []
for i in range(1, n):
	if a[i] + a[i - 1] < l:
		ans.append(i)
	else:
		for j in range(n - 1, i - 1, -1):
			ans.append(j)
		print('Possible')
		print(*ans, sep='\n')
		exit()
print('Impossible')


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
for N in range(n - 1):
	a[N] = a[N] + a[N + 1]
if max(a) >= l:
	print('Possible')
	ind = a.index(max(a)) + 1
	for i in range(ind - 1):
		print(i + 1)
	for i in range(n - ind):
		print(n - i - 1)
else:
	print('Impossible')


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
MAX = 0
index = -1
for i in range(N - 1):
	if A[i] + A[i + 1] > MAX:
		MAX = A[i] + A[i + 1]
		index = i + 1
if MAX < L:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, index):
		print(i)
	for i in range(N - 1, index, -1):
		print(i)
	print(index)


(n, l) = map(int, input().split())
arr = list(map(int, input().split()))
psbl = False
pos = 0
for i in range(n - 1):
	if arr[i] + arr[i + 1] >= l:
		psbl = True
		pos = i
		break
if psbl:
	print('Possible')
	for i in range(0, pos):
		print(i + 1)
	for i in range(n - 2, pos, -1):
		print(i + 1)
	print(pos + 1)
else:
	print('Impossible')


def solve():
	global N, L
	(N, L) = map(int, input().split())
	a = list(map(int, input().split()))
	for i in range(N - 1):
		if a[i] + a[i + 1] >= L:
			return i + 1
	return False
ans = solve()
if ans:
	print('Possible')
	for i in range(1, ans):
		print(i)
	for i in range(N - 1, ans, -1):
		print(i)
	print(ans)
else:
	print('Impossible')


(N, L) = map(int, input().split())
A = [int(x) for x in input().split()]
psbl = False
ans = 0
for i in range(1, N):
	if A[i - 1] + A[i] >= L:
		psbl = True
		ans = i - 1
		break
if psbl == False:
	print('Impossible')
else:
	print('Possible')
	for i in range(ans):
		print(i + 1)
	for j in range(N - 1 - ans):
		print(N - j - 1)


(N, L) = map(int, input().split())
a = list(map(int, input().split()))
S = sum(a)
t = 0
m = 0
for k in range(len(a) - 1):
	if a[k] + a[k + 1] >= L:
		t = 1
		m = k + 1
		break
if t == 0:
	print('Impossible')
	exit()
else:
	print('Possible')
	for k in range(1, m):
		print(k)
	for l in range(len(a) - (k + 2)):
		print(len(a) - l - 1)
	print(m)


import sys
input = sys.stdin.readline
(N, L) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(N - 1):
	if a[i] + a[i + 1] >= L:
		print('Possible')
		for j in range(1, i + 1):
			print(j)
		for j in range(i + 1, N)[::-1]:
			print(j)
		exit()
print('Impossible')


(N, L) = map(int, input().split())
A = [int(i) for i in input().split()]
for i in range(1, N):
	if A[i - 1] + A[i] >= L:
		print('Possible')
		ans = []
		for j in range(1, i):
			ans.append(j)
		for k in range(N - 1, i, -1):
			ans.append(k)
		ans.append(i)
		print(*ans, sep='\n')
		exit()
print('Impossible')


(N, L) = map(int, input().split())
a = [int(i) for i in input().split()]
Longest_pair = 0
p = 0
for i in range(N - 1):
	if a[i] + a[i + 1] > Longest_pair:
		Longest_pair = a[i] + a[i + 1]
		p = i + 1
if Longest_pair < L:
	print('Impossible')
	exit()
else:
	print('Possible')
for i in range(1, p):
	print(i)
for i in range(p + 1, N)[::-1]:
	print(i)
print(p)


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
ma = 0
midx = 0
for i in range(n - 1):
	if ma < a[i] + a[i + 1]:
		midx = i
		ma = a[i] + a[i + 1]
if l > ma:
	print('Impossible')
else:
	print('Possible')
	for i in range(midx):
		print(i + 1)
	for i in range(n - 1, midx, -1):
		print(i)


(n, l) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
maxsum = 0
maxind = 0
for i in range(n - 1):
	s = a[i] + a[i + 1]
	if s > maxsum:
		maxsum = s
		maxind = i + 1
if maxsum < l:
	print('Impossible')
else:
	print('Possible')
	for i in range(1, maxind):
		print(i)
	for i in range(n - 1, maxind, -1):
		print(i)
	print(maxind)


(N, L) = list(map(int, input().split()))
a = list(map(int, input().split()))
a_list = []
for i in range(N - 1):
	a_list.append([a[i] + a[i + 1], i])
a_list = sorted(a_list, key=lambda x: x[0], reverse=True)
if a_list[0][0] >= L:
	n = a_list[0][1]
	print('Possible')
	for i in range(n):
		print(i + 1)
	for i in range(N - 2 - n):
		print(N - 1 - i)
	print(n + 1)
else:
	print('Impossible')


(N, L) = list(map(int, input().split()))
A = list(map(int, input().split()))
for i in range(N - 1):
	if A[i] + A[i + 1] >= L:
		print('Possible')
		k = i
		break
else:
	print('Impossible')
	exit()
ans = [0] * (N - 1)
ans[k] = N - 1
for i in range(k):
	ans[i] = i + 1
for i in range(N - 2 - k):
	ans[N - i - 2] = k + i + 1
for i in range(N - 1):
	print(ans[i])


import sys
sys.setrecursionlimit(200000)
(n, l) = map(int, input().split())
r = list(map(int, input().split()))
last = 0
tiepoint = 0
for i in range(n - 1):
	if r[i] + r[i + 1] > last:
		last = r[i] + r[i + 1]
		tiepoint = i
if last >= l:
	print('Possible')
	for i in range(tiepoint):
		print(i + 1)
	for i in range(tiepoint + 1, n - 1)[::-1]:
		print(i + 1)
	print(tiepoint + 1)
else:
	print('Impossible')


(n, length) = list(map(int, input().split()))
nums = list(map(int, input().split()))
idx = -1
for i in range(n - 1):
	if nums[i] + nums[i + 1] >= length:
		idx = i
		break
if idx < 0:
	print('Impossible')
	exit()
print('Possible')
for i in range(idx):
	print(i + 1)
for i in reversed(range(idx, n - 1)):
	print(i + 1)


(n, l) = map(int, input().split())
a = [int(i) for i in input().split()]
b = []
for i in range(n - 1):
	b.append(a[i] + a[i + 1])
if max(b) >= l:
	ans = 'Possible'
else:
	ans = 'Impossible'
print(ans)
if ans == 'Possible':
	k = b.index(max(b))
	ans = list(range(1, k + 1)) + list(range(n - 1, k + 1, -1)) + [k + 1]
	for i in ans:
		print(i)


(n, l) = map(int, input().split())
(*a,) = map(int, input().split())
mx = 0
ind = -1
for i in range(n - 1):
	if mx <= a[i + 1] + a[i]:
		ind = i
		mx = a[i + 1] + a[i]
if mx >= l:
	print('Possible')
	for i in range(ind):
		print(i + 1)
	for i in range(n - 1, ind, -1):
		print(i)
else:
	print('Impossible')


(N, L, *A) = map(int, open(0).read().split())
for (i, a, b) in zip(range(1, N), A, A[1:]):
	if a + b >= L:
		print('Possible', *range(1, i))
		print(*range(N - 1, i - 1, -1))
		quit()
print('Impossible')


(N, L) = map(int, input().split())
src = list(map(int, input().split()))
for (i, (a, b)) in enumerate(zip(src, src[1:])):
	if a + b >= L:
		print('Possible')
		for j in range(1, i + 1):
			print(j)
		for j in range(N - 1, i, -1):
			print(j)
		exit()
print('Impossible')


(N, L) = map(int, input().split())
A = list(map(int, input().split()))
d = [A[i] + A[i + 1] for i in range(N - 1)]
if max(d) < L:
	print('Impossible')
else:
	print('Possible')
	j = 0
	while d[j] < L:
		j += 1
	for i in range(j):
		print(i + 1)
	for i in range(j, N - 1):
		print(N - i + j - 1)


def get_ints():
	return list(map(int, input().split()))
[n, l] = get_ints()
a = get_ints()
for i in range(n - 1):
	if a[i] + a[i + 1] < l:
		continue
	print('Possible')
	for j in range(1, i + 1):
		print(j)
	for j in range(n - 1, i, -1):
		print(j)
	exit(0)
print('Impossible')