Problem:
   Problem Statement 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.        Sample Input 1 3 50
30 20 10      Sample Output 1 Possible
2
1  If the knot 1 is untied first, the knot 2 will become impossible to untie.       Sample Input 2 2 21
10 10      Sample Output 2 Impossible       Sample Input 3 5 50
10 20 30 40 50      Sample Output 3 Possible
1
2
3
4  Another example of a possible solution is 3 , 4 , 1 , 2 .

Solution (Python):

def main():
    N, L, *A = map(int, open(0).read().split())
    B = [i + j for i, j in zip(A, A[1:])]
    x = max(B)
    if x >= L:  
        idx = B.index(x) + 1
        
        ans = [i for i in range(1, idx)] + [i for i in range(N - 1, idx, -1)] + [idx]
        print("Possible")
        print("\n".join(map(str, ans)))
    else:
        print("Impossible")


if __name__ == "__main__":
    main()

Solution (Python):


n,k=map(int,input().split())
a=list(map(int,input().split()))
ans=[]
res=[]
last=0

flag=False
for i in range(n-1):
    if flag:
        res.append(i+1)
        continue
    if a[i]+a[i+1]<k:
        ans.append(i+1)
    elif not flag:
        last=i
        flag=True

if not flag:
    print('Impossible')
    exit()
if res:
    for e in res[::-1]:
        ans.append(e)
ans.append(last+1)

print('Possible')
print(*ans,sep='\n')

Solution (Python):
N, L = map(int, input().split())

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

ans_index = -1
for i in range(N-1):
    if A[i] + A[i+1] >= L:
        ans_index = i
        break

if ans_index == -1:
    print('Impossible')
    exit()
print('Possible')

ans_index += 1
for i in range(1, ans_index):
    print(i)
for i in range(N-1, ans_index, -1):
    print(i)

print(ans_index)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
import sys,bisect,heapq

mod = 10**9+7
dd = ((-1, 0), (0, -1), (1, 0), (0, 1))

def I(): return(int(sys.stdin.readline()))
def LI(): return([int(x) for x in sys.stdin.readline().split()])
def S(): return(input())
def IR(n): return([I() for _ in range(n)])

def GCD(a,b):
    while(a%b != 0):
        a,b = b,a%b
    return b

def LCM(a,b):
    return a*b//GCD(a,b)

def main():
    N,L = LI()
    A = LI()
    ans = "Impossible"

    for i in range(N-1):
        if A[i]+A[i+1] >= L:
            ans = "Possible"
            last = i+1
            break

    if ans == "Impossible":
        print(ans)
    else:
        print(ans)
        for i in range(1,last):
            print(i)
        for i in range(N-1,last,-1):
            print(i)
        print(last)







    

if __name__ == "__main__":
    main()

Solution (Python):
N, L = map(int, input().split())
a = [int(i) for i in input().split()]

max_k = 0
max_p = 0

for i in range(N-1):
    if a[i]+a[i+1] > max_k:
        max_k = a[i]+a[i+1]
        max_p = i+1

if max_k < L:
    print('Impossible')
    exit()
else:
    print('Possible')

for i in range(1, N):
    if i == max_p:
        break
    else:
        print(i)

for i in range(N-1, 0, -1):
    if i == max_p:
        print(i)
        exit()
    else:
        print(i)

Solution (Python):
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)

Solution (Python):



import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,l = LI()
a = LI()
tmp = 0
inde = 0
for i in range(1,n):
  if tmp < a[i] + a[i-1]:
    tmp = a[i]+a[i-1]
    inde = i
if tmp < l:
  print('Impossible')
  quit()
print('Possible')
for i in range(1,inde):
  print(i)
for i in range(inde+1,n)[::-1]:
  print(i)
print(inde)

Solution (Python):
from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,l = inpl()
a = inpl()
for i in range(1,n):
    if a[i] + a[i-1] >= l:
        print('Possible')
        for j in range(1,i):
            print(j)
        for k in range(i+1,n)[::-1]:
            print(k)
        print(i)
        break
else:
    print('Impossible')

Solution (Python):
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")

Solution (Python):

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)

Solution (Python):
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')

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007


def A():

    return


def B():
    n,m = LI()
    f = [1]*n
    l = [0]*n
    l[0] = 1
    for i in range(m):
        x,y = LI()
        x -= 1
        y -= 1
        if l[x]:
            l[y] = 1
        f[x] -= 1
        f[y] += 1
        if f[x] == 0:
            l[x] = 0
    ans = 0
    for i in range(n):
        if l[i]:
            ans += 1
    print(ans)
    return


def C():
    n,l = LI()
    a = LI()
    for i in range(n-1):
        if a[i]+a[i+1] >= l:
            break
    else:
        print("Impossible")
        return
    ans = list(range(1,i+1))+list(range(i+2,n))[::-1]+[i+1]
    print("Possible")
    for i in ans:
        print(i)
    return


def D():

    return


def E():

    return


def F():

    return


if __name__ == "__main__":
    C()

Solution (Python):
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 k in range(n-1,i,-1):
            print(k)
        exit()
print("Impossible")

Solution (Python):
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations
import sys
import bisect
import string
import math
import time
ts=time.time()
sys.setrecursionlimit(10**6)
def SI():
    return input().split()
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
YN=['Yes','No']
mo=10**9+7

n,l=MI()
a=LI()
ans='Impossible'
an=[]
for i in range(n-1):
    if a[i]+a[i+1]>=l:
        ans='Possible'
        an+=[i+1]
        break

print(ans)
if ans=='Possible':
    an+=list(range(an[0]+1,n))
    an+=list(range(1,an[0]))[::-1]
    for i in an[::-1]:
        print(i)

Solution (Python):
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')

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n, l = list(map(int, input().rstrip('\n').split()))
    a = list(map(int, input().rstrip('\n').split()))
    for i in range(1, n):
        if a[i] + a[i-1] >= l:
            print("Possible")
            for j in range(n-1, i, -1):
                print(j)
            for j in range(1, i):
                print(j)
            print(i)
            exit()
    print("Impossible")


if __name__ == '__main__':
    slove()

Solution (Python):
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')

Solution (Python):
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)

Solution (Python):
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')

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

"""
逆再生。長さL以上になるものをくっつけられる。
一度L以上になったらそこだけ見ていけばよい
"""

N,L = map(int,input().split())
A = [int(x) for x in input().split()]

A2 = [x+y for x,y in zip(A,A[1:])]

M = max(A2)
i = A2.index(M)
if M < L:
    answer = ['Impossible']
else:
    answer = ['Possible']
    i += 1 
    answer += [str(x) for x in range(1,i)] + [str(x) for x in range(N-1,i,-1)] + [str(i)]

print('\n'.join(answer))

Solution (Python):
n,l = map(int,input().split())
arr = list(map(int,input().split()))

key = 0
flag = False
for i in range(n-1):
    if arr[i] + arr[i+1] >= l:
        key = [i,i+1]
        flag = True
        break


if flag:
    print("Possible")
    for i in range(key[0]):
        print(i+1)
    temp = []
    for i in range(key[1]+1,n):
        temp.append(i)
    temp.reverse()
    for t in temp:
        print(t)
    print(key[1])

else:
    print("Impossible")

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n, l = list(map(int, input().rstrip('\n').split()))
    a = list(map(int, input().rstrip('\n').split()))
    s = sum(a)
    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")


if __name__ == '__main__':
    slove()

Solution (Python):
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)

Solution (Python):

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


if __name__ == "__main__":
    main()

Solution (Python):

def main():
    N, L = tuple(map(int, input().split()))
    A = tuple(map(int, input().split()))
    B = [i + j for i, j in zip(A, A[1:])]
    x = max(B)
    if x >= L:
        idx = B.index(x) + 1
        ans = [i for i in range(1, idx)] 
        ans += [i for i in range(N - 1, idx, -1)] + [idx]
        print("Possible")
        print(*ans, sep="\n")
    else:
        print("Impossible")


if __name__ == "__main__":
    main()

Solution (Python):
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)

Solution (Python):
import sys
import heapq
from operator import itemgetter
from collections import deque, defaultdict
from bisect import bisect_left, bisect_right
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10**9 + 7

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

    left = 0
    for i in range(N - 1):
        if A[i] + A[i + 1] >= L:
            print('Possible')
            left = i
            break
    else:
        print('Impossible')
        return

    for i in range(left):
        print(i + 1)
    for j in range(left, N - 1)[:: -1]:
        print(j + 1)


sol()

Solution (Python):
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)

Solution (Python):
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
if k>=0:
	print('Possible')
	for i in range(k+1,N-1)[::-1]:
		print(i+1)
	for i in range(k+1):
		print(i+1)
else:
	print('Impossible')

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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+1
        break

if x == -1:
    print('Impossible')
else:
    print('Possible')
    for i in range(1,x):
        print(i)
    for i in range(n-x):
        print(n-i-1)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

large_pair = -1

for i in range(N-1):
    if A[i]+A[i+1] >= L:
        large_pair = i
        break

if large_pair == -1:
    ans = "Impossible"
    print(ans)
else:
    
    ans = "Possible"
    order = [large_pair]
    for a in reversed(range(large_pair)):
        order.append(a)
    for a in range(large_pair+1, N-1):
        order.append(a)

    print(ans)
    print("\n".join(map(lambda x: str(x+1), reversed(order))))

Solution (Python):
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

ans = "Possible"
large_pair = -1
for i in range(N-1):
    if A[i]+A[i+1] >= L:
        large_pair = i
        break
if large_pair == -1:
    ans = "Impossible"
    print(ans)
else:
    order = [large_pair]
    start = large_pair
    left = start-1
    right = start+1

    while left >= 0:
        order.append(left)
        left -= 1

    while right < N-1:
        order.append(right)
        right += 1

    print(ans)
    print("\n".join(map(lambda x: str(x+1), reversed(order))))

Solution (Python):
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,-1):
    print(i+1)

Solution (Python):
N, L = [int(_) for _ in raw_input().split(" ")]
ret =  [int(_) for _ in raw_input().split(" ")]
index = 0
for i in range(1, len(ret)):
  s = ret[i] + ret[i-1]
  if  L <= s:
    index = i+1
    break

if index == 0:
  print "Impossible"
else:
  print "Possible"
  for i in range(len(ret)-1, index-1, -1):
    print i
  for i in range(1, index):
    print i

Solution (Python):
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])

Solution (Python):
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")


if __name__ == "__main__":
    main()

Solution (Python):
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")

Solution (Python):
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)

Solution (Python):
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')

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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)

Solution (Python):

import sys

YES = "Possible"  
NO = "Impossible"  

def solve(N: int, L: int, a: "List[int]"):
    pair_length = [a[i] + a[i+1] for i in range(N-1)]
    longest_pair = max(pair_length)
    
    if longest_pair < L:
        print(NO)
        return
    
    print(YES)
    last_knot = pair_length.index(longest_pair)
    for i in range(last_knot):
        print(i+1)
    for i in range(N-2, last_knot-1, -1):
        print(i+1)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    L = int(next(tokens))  
    a = [ int(next(tokens)) for _ in range(N) ]  
    solve(N, L, a)

if __name__ == '__main__':
    main()

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
n,l = [int(i) for i in input().split()]
a=[int(i) for i in input().split()]


max_len   = a[0]+a[1]
max_joint = 1

for i in range(1,n-1):
    len = a[i] + a[i+1]
    if len > max_len:
        max_len   = len
        max_joint = i+1


if max_len < l:
    print("Impossible")
    exit()
else:
    print("Possible")
    for i in range(1,max_joint):
        print(i)
    for i in range(n-1, max_joint, -1):
        print(i)
    print(max_joint)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, L] = [int(input_raw[0]), int(input_raw[1])]
    input_raw = read_func().strip().split()
    A = [int(input_raw[i]) for i in range(N)]
    B = deque([A[i] + A[i + 1] for i in range(N - 1)])
    sumA = sum(A)
    s_idx = 1
    t_idx = len(B)
    seq = []
    for i in range(N - 1):
        if sumA < L:
            print "Impossible"
            return
        if B[len(B) - 1] < L:
            B.pop()
            sumA -= A[t_idx]
            seq.append(t_idx)
            t_idx -= 1

        else :
            B.popleft()
            sumA -= A[s_idx - 1]
            seq.append(s_idx)
            s_idx += 1
        if len(seq) == N - 1:
            break

    print "Possible"
    for i in range(len(seq)):
        print seq[i]





if __name__ == '__main__':
    main()

Solution (Python):
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)

Solution (Python):
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")

Solution (Python):
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)