#include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
signed main(){
  int x,y,z;
  cin>>x>>y>>z;
  int n=x+y+z;
  int a[n],b[n],c[n];
  for(int i=0;i<n;i++) cin>>a[i]>>b[i]>>c[i];
  int ans=0;
  for(int i=0;i<x;i++) ans+=a[i];
  for(int i=x;i<x+y;i++) ans+=b[i];
  for(int i=x+y;i<x+y+z;i++) ans+=c[i];
  priority_queue<P> q[6];
  set<int> sa,sb,sc;
  for(int i=0;i<x;i++){
    sa.insert(i);
    q[0].push(P(b[i]-a[i],i));
    q[5].push(P(c[i]-a[i],i));
  }
  for(int i=x;i<x+y;i++){
    sb.insert(i);
    q[1].push(P(a[i]-b[i],i));
    q[2].push(P(c[i]-b[i],i));
  }
  for(int i=x+y;i<x+y+z;i++){
    sc.insert(i);
    q[3].push(P(b[i]-c[i],i));
    q[4].push(P(a[i]-c[i],i));
  }
  while(1){
    int sw=-1,dif,idx,idy,idz;
    {
      int tx=-1,ty=-1,tmp=0;
      while(!q[0].empty()){
	P p=q[0].top();
	if(!sa.count(p.second)){
	  q[0].pop();
	  continue;
	}
	tx=p.second;tmp+=p.first;
	break;
      }
      while(!q[1].empty()){
	P p=q[1].top();
	if(!sb.count(p.second)){
	  q[1].pop();
	  continue;
	}
	ty=p.second;tmp+=p.first;
	break;
      }
      //cout<<"a<->b "<<tx<<" "<<ty<<" "<<tmp<<endl;
      if((~tx) && (~ty) && tmp > 0){
	if(sw<0||dif<tmp){
	  sw=1;
	  dif=tmp;
	  idx=tx;
	  idy=ty;
	}
      }
    }
    {
      int tx=-1,ty=-1,tmp=0;
      while(!q[2].empty()){
	P p=q[2].top();
	if(!sb.count(p.second)){
	  q[2].pop();
	  continue;
	}
	tx=p.second;tmp+=p.first;
	break;
      }
      while(!q[3].empty()){
	P p=q[3].top();
	if(!sc.count(p.second)){
	  q[3].pop();
	  continue;
	}
	ty=p.second;tmp+=p.first;
	break;
      }
      //cout<<"b<->c "<<tx<<" "<<ty<<" "<<tmp<<endl;
      if((~tx) && (~ty) && tmp > 0){
	if(sw<0||dif<tmp){
	  sw=2;
	  dif=tmp;
	  idx=tx;
	  idy=ty;
	}
      }
    }
    {
      int tx=-1,ty=-1,tmp=0;
      while(!q[4].empty()){
	P p=q[4].top();
	if(!sc.count(p.second)){
	  q[4].pop();
	  continue;
	}
	tx=p.second;tmp+=p.first;
	break;
      }
      while(!q[5].empty()){
	P p=q[5].top();
	if(!sa.count(p.second)){
	  q[5].pop();
	  continue;
	}
	ty=p.second;tmp+=p.first;
	break;
      }
      
      //cout<<"c<->a "<<tx<<" "<<ty<<" "<<tmp<<endl;
      if((~tx) && (~ty) && tmp > 0){
	if(sw<0||dif<tmp){
	  sw=3;
	  dif=tmp;
	  idx=tx;
	  idy=ty;
	}
      }
    }

    
    {
      int tx=-1,ty=-1,tz=-1,tmp=0;
      while(!q[0].empty()){
	P p=q[0].top();
	if(!sa.count(p.second)){
	  q[0].pop();
	  continue;
	}
	tx=p.second;tmp+=p.first;
	break;
      }
      while(!q[2].empty()){
	P p=q[2].top();
	if(!sb.count(p.second)){
	  q[2].pop();
	  continue;
	}
	ty=p.second;tmp+=p.first;
	break;
      }     
      while(!q[4].empty()){
	P p=q[4].top();
	if(!sc.count(p.second)){
	  q[4].pop();
	  continue;
	}
	tz=p.second;tmp+=p.first;
	break;
      }      
      if((~tx) && (~ty) && (~tz) && tmp > 0){
	if(sw<0||dif<tmp){
	  sw=4;
	  dif=tmp;
	  idx=tx;
	  idy=ty;
	  idz=tz;
	}
      }
    }
    
    {
      int tx=-1,ty=-1,tz=-1,tmp=0;
      while(!q[5].empty()){
	P p=q[5].top();
	if(!sa.count(p.second)){
	  q[5].pop();
	  continue;
	}
	tx=p.second;tmp+=p.first;
	break;
      }
      while(!q[1].empty()){
	P p=q[1].top();
	if(!sb.count(p.second)){
	  q[1].pop();
	  continue;
	}
	ty=p.second;tmp+=p.first;
	break;
      }     
      while(!q[3].empty()){
	P p=q[3].top();
	if(!sc.count(p.second)){
	  q[3].pop();
	  continue;
	}
	tz=p.second;tmp+=p.first;
	break;
      }      
      if((~tx) && (~ty) && (~tz) && tmp > 0){
	if(sw<0||dif<tmp){
	  sw=5;
	  dif=tmp;
	  idx=tx;
	  idy=ty;
	  idz=tz;
	}
      }
    }
    
    if(sw==1){
      q[0].pop();
      q[1].pop();
      
      sa.erase(idx);
      sb.insert(idx);
      ans+=b[idx]-a[idx];
      q[1].push(P(a[idx]-b[idx],idx));
      q[2].push(P(c[idx]-b[idx],idx));
      
      sb.erase(idy);
      sa.insert(idy);
      ans+=a[idy]-b[idy];
      q[0].push(P(b[idy]-a[idy],idy));
      q[5].push(P(c[idy]-a[idy],idy));
      continue;
    }
    if(sw==2){
      q[2].pop();
      q[3].pop();
      
      sb.erase(idx);
      sc.insert(idx);
      ans+=c[idx]-b[idx];
      q[3].push(P(b[idx]-c[idx],idx));
      q[4].push(P(a[idx]-c[idx],idx));
      
      sc.erase(idy);
      sb.insert(idy);
      ans+=b[idy]-c[idy];
      q[1].push(P(a[idy]-b[idy],idy));
      q[2].push(P(c[idy]-b[idy],idy));
      continue;
    }
    if(sw==3){
      q[4].pop();
      q[5].pop();
      
      sc.erase(idx);
      sa.insert(idx);
      ans+=a[idx]-c[idx];
      q[0].push(P(b[idx]-a[idx],idx));
      q[5].push(P(c[idx]-a[idx],idx));
      
      sa.erase(idy);
      sc.insert(idy);
      ans+=c[idy]-a[idy];
      q[3].push(P(b[idy]-c[idy],idy));
      q[4].push(P(a[idy]-c[idy],idy));

      continue;
    }

    if(sw==4){
      q[0].pop();
      q[2].pop();
      q[4].pop();
      
      sa.erase(idx);
      sb.insert(idx);
      ans+=b[idx]-a[idx];
      q[1].push(P(a[idx]-b[idx],idx));
      q[2].push(P(c[idx]-b[idx],idx));

      sb.erase(idy);
      sc.insert(idy);
      ans+=c[idy]-b[idy];
      q[3].push(P(b[idy]-c[idy],idy));
      q[4].push(P(a[idy]-c[idy],idy));
      
      sc.erase(idz);
      sa.insert(idz);
      ans+=a[idz]-c[idz];
      q[0].push(P(b[idz]-a[idz],idz));
      q[5].push(P(c[idz]-a[idz],idz));
      
      continue;
    }
    
    if(sw==5){
      q[5].pop();
      q[3].pop();
      q[1].pop();
      
      sa.erase(idx);
      sc.insert(idx);
      ans+=c[idx]-a[idx];
      q[3].push(P(b[idx]-c[idx],idx));
      q[4].push(P(a[idx]-c[idx],idx));

      sb.erase(idy);
      sa.insert(idy);
      ans+=a[idy]-b[idy];
      q[0].push(P(b[idy]-a[idy],idy));
      q[5].push(P(c[idy]-a[idy],idy));
      
      sc.erase(idz);
      sb.insert(idz);
      ans+=b[idz]-c[idz];
      q[1].push(P(a[idz]-b[idz],idz));
      q[2].push(P(c[idz]-b[idz],idz));
      
      continue;
    }
    
    break;
  }

  /*
  cout<<"Au:";for(int u:sa) cout<<u<<" ";cout<<endl;
  cout<<"Ag:";for(int u:sb) cout<<u<<" ";cout<<endl;
  cout<<"Cu:";for(int u:sc) cout<<u<<" ";cout<<endl;
  */
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 12392