#include <bits/stdc++.h> using namespace std; typedef long long LL; const int maxn =2000010; LL numa[maxn]; int main() { int lena,lenb; ios::sync_with_stdio(false); cin>>lena; for(int i=1;i<=lena;i++) cin>>numa[i]; cin>>lenb; for(int i=lena+1;i<=lenb+lena;i++) cin>>numa[i]; sort(numa+1,numa+lena+lenb+1); cout<<numa[(lena+lenb+1)/2]<<endl; }