Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func main() {
	scanner.Split(bufio.ScanWords)
	a := make([]int, 8)
	for i := 0; i < 8; i++ {
		a[i] = nextInt()
	}
	s := 0
	for i := 0; i < 4; i++ {
		s += a[i]
	}
	t := 0
	for i := 4; i < 8; i++ {
		t += a[i]
	}
	fmt.Println(max(s, t))
}

C++: #include <iostream>
using namespace std;

int main(){
  int sum1=0,sum2=0;  

  for(int a,i=0;i<4;++i){
    cin>>a;sum1+=a;
  }
  for(int a,i=0;i<4;++i){
    cin>>a; sum2+=a;
  }

  if(sum1>sum2) cout<<sum1<<endl;
  else cout<<sum2<<endl;
  return 0;
}

C++: #include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

int gcd(int a,int b){
	if(!b) return a;
	return gcd(b,a%b);
}

int A,B;

int main(){
	int t;
	for(int i=0;i<4;i++){
		cin>>t;
		A+=t;
	}
	for(int i=0;i<4;i++){
		cin>>t;
		B+=t;
	}
	cout<<((A>B)?A:B)<<endl;
	
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
int a=0,b=0,x;
for(int i=0;i<8;i++){scanf("%d",&x); if(i<=3) a+=x; else b+=x;}
printf("%d\n",max(a,b));
}

C++: #include<iostream>

#include<string>

using namespace std;

int main(){

  int a,b,c,d,e,f,g,h;
  cin>>a>>b>>c>>d>>e>>f>>g>>h;



  if(a+b+c+d>=e+f+g+h){cout<<a+b+c+d<<endl;}
  else{cout<<e+f+g+h<<endl;}


  return 0;
}

C++: #include<iostream>
using namespace std;

int main()
{
	int a, b, s=0, t=0, i;

	for (i = 0; i < 4; i++){
		cin >> a;
		s += a;
	}

	for (i = 0; i < 4; i++){
		cin >> b;
		t += b;
	}

	if (s > t){ cout << s << endl; }
	else{ cout << t << endl; }

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cctype>
using namespace std;
int main(){
  int sum_a = 0,sum_b = 0;
  for(int i = 0;i < 4;i++){
    int tmp;
    cin >> tmp;
    sum_a += tmp;
  }
  for(int i = 0;i < 4;i++){
    int tmp;
    cin >> tmp;
    sum_b += tmp;
  }
  if(sum_a >= sum_b)cout << sum_a << endl;
  else cout << sum_b << endl;
  
    
  
  return 0;
}
vector<string> split(string str,string delim){
  vector<string> items;
  size_t dlm_idx;
  if(str.npos == (dlm_idx = str.find_first_of(delim))){
    items.push_back(str.substr(0,dlm_idx));
  }
  while(str.npos != (dlm_idx = str.find_first_of(delim))){
    if(str.npos == str.find_first_not_of(delim)){
      break;
    }
    items.push_back(str.substr(0,dlm_idx));
    dlm_idx++;
    str = str.erase(0,dlm_idx);
    if(str.npos == str.find_first_of(delim) && "" != str){
      items.push_back(str);
      break;
    }
  }
  return items;
}

C++: #include <iostream>

using namespace std;

int main(void){
int asum = 0,bsum = 0;
for(int i  = 0;i < 4;i++){
int x;
cin >> x;
asum += x;
}
for(int i = 0;i < 4;i++){
int x;
cin >> x;
bsum += x;
}
cout << max(asum,bsum) << endl;
return 0;
}

C++:  #include<iostream>
using namespace std;

int main () {
	int a1,a2,a3,a4,b1,b2,b3,b4;
	int S,T;
	cin>>a1>>a2>>a3>>a4>>b1>>b2>>b3>>b4;	
	S=a1+a2+a3+a4;
	T=b1+b2+b3+b4;
	if(S>T){
		cout<< S <<'\n';
	}else{if(S<T){
		cout<< T <<'\n';
	}else{
		cout<< S <<'\n';
	}
}
	return 0;
}

C++: #include<iostream>
using namespace std;

int main(){

	int score[2][4];
	int sum_A=0;
	int sum_B=0;

	for (int i = 0; i < 2; i++){
		for (int j = 0; j < 4; j++){
			cin >> score[i][j];
		}
	}

	for (int i = 0; i < 4; i++){
		sum_A += score[0][i];
		sum_B += score[1][i];
	}

	if (sum_A >= sum_B){
		cout << sum_A;
	}
	else {
		cout << sum_B;
	}
	//getchar();

	return 0;
}

C++: #include <iostream>
using namespace std;
int kobuta;
int tanuki;
int kitune;
int neko;
int koara;
int rakko;
int komodoootokage;
int gengorou;
int usi;
int main(){
  cin>>kobuta>>tanuki>>kitune>>neko;
  cin>>koara>>rakko>>komodoootokage>>gengorou;
  if(kobuta+tanuki+kitune+neko>koara+rakko+komodoootokage+gengorou){
    cout<<kobuta+tanuki+kitune+neko;}
  else{
    cout<<koara+rakko+komodoootokage+gengorou;}
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(int i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(int i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007
 
int main(){
	int t,a=0,b=0;
	rep(i,4) cin>>t, a+=t;
	rep(i,4) cin>>t, b+=t;
	cout<<max(a,b)<<endl;
}

C++: #include <cstdio>
main(){
	int a[4],ar[3],n=2;
	while(n--){
	scanf("%d%d%d%d",a,a+1,a+2,a+3);
	ar[n]=*a+a[1]+a[2]+a[3];
	}
	printf("%d\n",*ar>ar[1]?*ar:ar[1]);
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main(){
  int a, b, c, d, e, f,	g, h;
  cin >> a >> b >> c >> d >> e >> f >> g >> h;
  if(a + b + c + d > e + f + g + h)
    printf("%d\n", a + b + c + d);
  else
    printf("%d\n", e + f + g + h);

  return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<math.h>

using namespace std;

int x,s,t;

int main(){
	for(int i=0;i<2;i++){
		for(int j=0;j<4;j++){
			cin>>x;
			if(i==0){s+=x;}
			else{t+=x;}
		}
	}
	cout<<max(s,t)<<endl;
	return 0;
}

C++: #include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;

int main(){
    int suma=0, sumb=0, temp;
    for(int i = 0;i<4;i++){
        cin >> temp;
        suma += temp;
    }
    for(int i = 0;i<4;i++){
        cin >> temp;
        sumb += temp;
    }
    cout << max(suma, sumb) << endl;
    return 0;
}

C++: #include <iostream>
using namaspace std;
int main(void)
{
	int a,b=0;
	for (int c=0;c<4;c++){
		cin>>a;
		b=b+a;
	}
	c=0;
	for (int d=0;d<4;d++){
		cin>>a;
		c=c+a;
	}
	if (c>b) cout<<c<<endl;
	else cout<<b<<endl;
	return 0;
}

C++: #include<iostream>
#include<vector>

class TestScore{
private:
    std::vector<int> dataset = {0,0,0,0};
public:
    void setTestScore(int info,int math,int scie,int eng);
    int getTotalScore();
};

void TestScore::setTestScore(int info,int math,int scie,int eng){
    dataset[0] = info;
    dataset[1] = math;
    dataset[2] = scie;
    dataset[3] = eng;
}

int TestScore::getTotalScore(){
    int total_score = 0;
    for(int score : dataset){
        total_score += score; 
    }
    return total_score;
}

int largeScore(int a,int b){
    if(a < b){
        return b;
    }
    return a;
}

int main(){

    TestScore ts1 = TestScore();
    TestScore ts2 = TestScore();

    int a,b,c,d;
    a = 0;
    b = 0;
    c = 0;
    d = 0;
    
    std::cin >> a >> b >> c >> d;
    ts1.setTestScore(a,b,c,d);

    std::cin >> a >> b >> c >> d;
    ts2.setTestScore(a,b,c,d);

    std::cout << largeScore(ts1.getTotalScore(),ts2.getTotalScore()) << std::endl;

    return 0;
}