n=input()
tar=int(input())
n=n.replace("[",’’)
n=n.replace("]",’’)
n=n.replace(’,’,’ ')
n=n.split()
flag=0
target=[]
for i in range(len(n)):
for j in range(i+1,len(n)):
if (i!=j and int(n[i])+int(n[j])tar):
target.append(i)
target.append(j)
flag=1
break
if flag1:
break
print(target)