import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int n1=scanner.nextInt();
ArrayList<Long>arrayList=new ArrayList<>();
for (int i=0;i<n1;i++){
arrayList.add(scanner.nextLong());
}
int n2=scanner.nextInt();
for (int i=0;i<n2;i++){
arrayList.add(scanner.nextLong());
}
Collections.sort(arrayList);
if (arrayList.size()%2==0){
System.out.println(arrayList.get(arrayList.size()/2-1));
}
else {
System.out.println(arrayList.get(arrayList.size()/2));
}
}
}