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<unordered_map>
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<chrono>
#include<cstdio>
#include<iomanip>
#include<algorithm>
#include<functional>
using namespace std;
typedef long long ll;
int main(){
	int a=0,b=0,c;
	for(int i=0;i<4;i++){
		cin>>c;
		a+=c;
	}
	for(int i=0;i<4;i++){
		cin>>c;
		b+=c;
	}
	cout<<max(a,b)<<endl;
}

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

int main(){
int a;
int b;
int c;
int d;
int e;
int f;
int g;
int h;
int i;
int j;
cin >> a;
cin >> b;
cin >> c;
cin >> d;
cin >> e;
cin >> f;
cin >> g;
cin >> h;
i=a+b+c+d;
j=e+f+g+h;
if(i<j){i=j;}
cout << i <<endl;
}

C++: #include<stdio.h>
int main(void)
{
	int　a1,a2,a3,a4,b1,b2,b3,b4,s,t;
	scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
	s=a1+a2+a3+a4;
	t=b1+b2+b3+b4;
	if(s<t){
		printf("%d\n",t);
	}
	else if(t<s){
		printf("%d\n",s);
	}
	else if(s==t){
		printf("%d\n",s);
	}
	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()
{
    int A[4], B[4];
    int S = 0, T = 0;
    for (int i = 0; i < 4; i++){
       cin >> A[i];
       S += A[i];
    }

    for (int j = 0; j < 4; j++){
        cin >> B[j];
        T += B[j];
    }

    int big = max(S, T);

    cout << big << endl;

    return 0;

}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main() {
	int a = 0, b = 0, x;
	rep(i, 4) {
		cin >> x;
		a += x;
	}

	rep(i, 4) {
		cin >> x;
		b += x;
	}

	if(a >= b) cout << a << endl;
	else cout << b << endl;

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
int aa,ab,ac,ad,ba,bb,bc,bd,sum_a,sum_b;
cin>>aa>ab>>ac>>ad;
cin>>ba>>bb>bc>>bd;
sum_a=aa+ab+ac+ad;
sum_b=ba+bb+bc+bd;
if(sum_a>=sum_b){
cout<<sum_a<<endl;
}else{
cout<<sum_b<<endl;
}

}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b=0;
	for (int c=0;c<4;c++){
		cin>>a;
		b=b+a;
	}
	int 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 <algorithm>
using namespace std;

int main() {
	int A, B, tmp;
	for (int i=0; i<4; i++) {
		cin >> tmp;
		A += tmp;
	}
	for (int i=0; i<4; i++) {
		cin >> tmp;
		B += tmp;
	}
	int ans = max(A, B);
	cout << ans << endl;
}

C++: #include <iostream>
#include <algorithm>
#define for(int i=0;i<n;i++) loop(i,n)
using namespace std;

int main(){
  int a=0, b=0, temp;
  loop(i,4){
    cin>>temp;
    a+=temp;
  }
  loop(i,4){
    cin>>temp;
    b+=temp;
  }
  cout<<max(a,b)<<endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int A=0,B=0;
	int score;
	for(int i=0; i<4; i++){
		cin >> score;
		A+=score;
	}
	for(int i=0; i<4; i++){
		cin >> score;
		B+=score;
	}
	score = max(A,B);
	cout << score << endl;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
    int res = 0, a;
    for (int i = 0; i < 2; i++) {
        int sum = 0;
        for (int j = 0; j < 4; j++) {
            cin >> a;
            sum += a;
        }
        res = max(res, sum);
    }
    cout << res << endl;
    return 0;
}

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

int score[2][4];
int T[2];
int main()
{
	for(int i=0;i<2;i++)
	{
		for(int j=0;j<4;j++)
		{
			cin >>score[i][j];
			T[i]+=score[i][j];
		}
	}
	if(T[1]>T[2])
	{
		cout<<T[1];
	}
	else 
	{
	cout<<T[2];
	}
}

C++: #include <iostream>
using namespace std;
int a,b,c,d,e,f,g,h,s,t;
int main()
{



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


	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
  int t, a=0, b=0;
  for(int i=0;i<4;i++){ cin >> t; a += t; }
  for(int i=0;i<4;i++){ cin >> t; b += t; }
  cout << max(a, b) << endl;
}

C++: #include <stdio.h>

int main ( )
{
	int a ;
	int b ;
	int t ;
	while ( scanf ( "%d" , &t ) == 1 ) {
		a = t ;
		b = 0 ;
		for ( int i = 0 ; i < 3 ; i++ ) {
			scanf ( "%d" , &t ) ;
			a += t ;
		}
		for ( int i = 0 ; i < 4 ; i++ ) {
			scanf ( "%d" , &t ) ;
			b += t ;
		}
		printf ( "%d\n" , ( a > b ) ? a : b ) ;
	}
	return 0 ;
}

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

int main(){
int W,X,Y,Z,w,x,y,z;
cin >> W >>X >> Y >> Z >> w >> x >>y >> z;

if( (W + X + Y + Z) > (w + x + y + z)){
    cout << W + X + Y + Z << endl;
}
else if( W + X + Y + Z) < (w + x + y + z)){
    cout << w + x + y + z << endl;
}
else{ 
    cout << w + x + y + z << endl;
}

return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int x1,x2,x3,x4,y1,y2,y3,y4,s,t;
	scanf("%d %d %d %d %d %d %d %d",&x1,&x2,&x3,&x4,&y1,&y2,&y3,&y4);
	s=x1+x2+x3+x4;
	t=y1+y2+y3+y4;
	if(s>t){
		printf("%d\n",s);
	}
	else if(s<t){
		printf("%d\n",t);
	}
	else if(s==t){
		printf("%d\n",t);
	}
	return 0;
}

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

int main() {
  int S = 0;
  for (int i = 0; i < 4; i++) {
    int score;
    cin >> score;
    S += score;
  }
  int T = 0;
  for (int i = 0; i < 4; i++) {
    int score;
    cin >> score;
    T += score;
  }

  if (S > T || S == T) {
    cout << S << endl;
  } else {
    cout << T << endl;
  }

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
  int A,tmp,res = 0;
  int B = 0;
  while(res < 8){
    cin >> tmp;
    if(res / 4 == 0){
      A += tmp;
    } else{
      B += tmp;
    }
    res++;
  }
  cout << (A > B ? A : B) << endl;
}

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

int main(){

  int i,m,s,e,x,y;

  cin >> i >> m >> s >> e;

  x = i + m + s + e;

  cin >> i >> m >> s >> e;

  y = i + m + s + e;

  cout << max(x,y) << endl;

}