Array target sum pair

one of test case did’t give correct output

here is code
n=int(input())
l=list()
for i in range(n):
l.append(int(input()))
target_sum=int(input())
l=sorted(l)

low=0
high=len(l)-1
while(low<high):
if(l[low]+l[high]==target_sum):
print(l[low],‘and’,l[high])
low+=1
high-=1
else:
high-=1