#include #include using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) using mint = atcoder::modint998244353; int main(){ int na,nb,nc; cin>>na>>nb>>nc; vector a(na),b(nb),c(nc); rep(i,na) cin>>a.at(i); rep(i,nb) cin>>b.at(i); rep(i,nc) cin>>c.at(i); priority_queue pa,pb,pc; ll sma=0,smb=0,smc=0; ll ca=0,cb=0,cc=0; rep(i,na){ if(a.at(i)>0){ sma+=a.at(i); ca++; }else{ pa.push(a.at(i)); } } rep(i,nb){ if(b.at(i)>0){ smb+=b.at(i); cb++; }else{ pb.push(b.at(i)); } } rep(i,nc){ if(c.at(i)>0){ smc+=c.at(i); cc++; }else{ pc.push(c.at(i)); } } while(!pa.empty()||!pb.empty()||!pc.empty()){ ll ndf=0; int d=-1; if(!pa.empty()){ ll ad=pa.top(); ll df=smc+cb*ad; if(ndf