1 test case gives run-error

sir, can you please tell me what is the problem in my code.
it is successful for one test case but gives run-error for the other.
also i need to ask that if we want to find the median and the frequency is even then we take average of (n/2-1)th and (n/2)th term. but in the sample output the median is given as (n/2-1)th term only, even the submission test case is not working for the actual median. kindly clear my doubt…
my code: ::
n = int(input())

str1 = input()
str2 = input()

list1 = str1.split(" “)
list2 = str2.split(” ")

li1 = []
li2 = []

for i in list1:
li1.append(int(i))

for i in list2:
li2.append(int(i))

li3 = li1 + li2
li3.sort()

print(li3[n-1])

total number will alwas be even beacuse it is 2*n. just take the nth number after sorting.

 int n,m,k;
 cin>>n;
 for(int i=0;i<2*n;i++) cin>>a[i];
 sort(a,a+2*n);
 cout<<a[n-1];

code in c++;

i have done the same thing in python… one of the test case is not accepting…

provide code link…

sir this is the link: