import java.util.Comparator; import java.util.PriorityQueue; import java.util.Scanner; public class e1 { public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in); while (scanner.hasNext()) { int count = 0;
            PriorityQueue<Integer> minHeap = new PriorityQueue<>();
            PriorityQueue<Integer> maxHeap = new PriorityQueue<Integer>(15, new Comparator<Integer>() { @Override  public int compare(Integer o1, Integer o2) { return o2 - o1;
                }
            }); int n = scanner.nextInt(); for (int i = 0; i < n; i++) { int num = scanner.nextInt(); if (count % 2 == 0) {
                    maxHeap.offer(num); int filteredMaxNum = maxHeap.poll();
                    minHeap.offer(filteredMaxNum);
                } else {
                    minHeap.offer(num); int filteredMinNum = minHeap.poll();
                    maxHeap.offer(filteredMinNum);
                }
                count++;
            } int m = scanner.nextInt(); for (int i = 0; i < m; i++) { int num = scanner.nextInt(); if (count % 2 == 0) {
                    maxHeap.offer(num); int filteredMaxNum = maxHeap.poll();
                    minHeap.offer(filteredMaxNum);
                } else {
                    minHeap.offer(num); int filteredMinNum = minHeap.poll();
                    maxHeap.offer(filteredMinNum);
                }
                count++;
            } if (count % 2 == 0) {
                System.out.println(new Double((minHeap.peek() + maxHeap.peek())) / 2);
            } else {
                System.out.println(new Double((minHeap.peek())));
            }
        }
    }
}