#include "bits/stdc++.h" #define REP(i,n,N) for(int i=(n); i<(N); i++) #define RREP(i,n,N) for(ll i=(N-1); i>=n; i--) #define CK(n,a,b) ((a)<=(n)&&(n)<(b)) #define ALL(v) (v).begin(),(v).end() #define p(s) cout<<(s)<>Nw) { vector vt[2]; REP(i, 0, Nw) { int w; cin >> w; vt[0].push_back(w); } cin >> Nb; REP(i, 0, Nb) { int b; cin >> b; vt[1].push_back(b); } sort(ALL(vt[0])); sort(ALL(vt[1])); int ans=0; REP(i,0,2){ int mx=0; int len = inf; int col = i; int nw = Nw-1; int nb = Nb-1; while (!((col==0&&nw==-1)||(col&&nb==-1))){ if(col==0){ if(vt[0][nw]