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>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm>
#include <numeric>
#include <typeinfo>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int sum(const vi& a)
{
	return accumulate(allof(a),0);
}
int main()
{
	vvi a(2,vi(4));
	rep(i,2)
		rep(j,4)
			cin>>a[i][j];
	cout<<max(sum(a[0]),sum(a[1]))<<endl;
	
	return 0;
}

C++: /*
	AOJ 0510 JOI yo 2005 2006 1 Score
*/

//ミスを防ぐためにまずは基本のIncludeをすべて格納する

#include<fstream>
#include<string>
#include<queue>
#include<algorithm>
#include<set>
#include<map>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<vector>
#define INF (1<<21)
using namespace std;
typedef paair<int,int> P;

//ここまで基本型、多少の変更はあるけどまあいける

int main()
{
	int a[4],b[4];
	int asum,bsum;


	cout >>a[0]>>a[1]>>a[2]>>a[3];
	cout >>b[0]>>b[1]>>b[2]>>b[3];

	asum=a[0]+a[1]+a[2]+a[3];
	bsum=b[0]+b[1]+b[2]+b[3];

	int high=asum;
	if (bsum>asum) {high = bsum;}
	
	cin<<high<<\n;

	return 0;
}

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

int main()
{
  int a = 0;
  int b = 0;
  for (int i = 0; i < 4; i++) {
      int s;
      cin >> s;
      a += s;
  }
  
  for (int i = 0; i < 4; i++) {
      int s;
      cin >> s;
      b+= s;
  }
  
  if (a > b) {
      cout << a << endl;
  }else {
      cout << b << endl;
  }
}

C++: #include<iostream>
using namespace std;
int i, p, sumA=0, sumB=0;
int main () {
    for (i=1; i<=4; i++) {
        cin >> p;
        sumA += p;
    }
    for (i=1; i<=4; i++) {
         cin >> p;
         sumB += p;
    }
    cout < max(sumA,sumB) << endl;
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int ma=0;
    for(int i=0;i<2;i++){
        int sum=0;
        for(int j=0;j<4;j++){
            int a;
            cin>>a;
            sum+=a;
        }
        ma=max(ma,sum);
    }
    cout<<ma<<endl;
    return 0;
}

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

int main(){
    int mx,score[2]={},input;
    for(int i=0;i<2;i++){
        for(int j=0;j<4;j++){
            cin>>input;
            score[i]+=input;
        }
    }
    mx=(score[0]>score[1])?score[0]:score[1];
    printf("%d\n",mx);
    return 0;
}

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

int main(){
int a,b,c,d,e,f,g,h,S,T;
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;
if(S<T) cout<<T;

return 0;
}

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

using namespace std;

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

C++: #include <cstdio>

int main(void) {
	int score[2] = { 0 };
	for(int i = 0; i < 2; i++) {
		for(int j = 0; j < 4; j++) {
			int buf;
			scanf("%d", &buf);
			score[i] += buf;
		}
	}
	
	printf("%d\n", score[0] > score[1] ? score[0] : score[1]);
	return 0;
}

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

int main() {
	int S,P,w,x,y,z,a,b,c,d;
	cin>>w>>x>>y>>z;
	S=w+x+y+z;
	cin>>a>>b>>c>>d;
	P=a+b+c+d;
	if(S==P){
		cout<<S<<endl;
	}
	int q = max(S,P);
	cout<<q<<endl;
	return 0;
}

C++: #include<stdio.h>
int main(){
int a=0,b=0,d;
for(int i=0;i<4;i++){
 scanf("%d",&d);
 a=a+d;
}

for(int i=0;i<4;i++){
 scanf("%d",&d);
 b=b+d;
}
if(a<=b) printf("%d\n",b);
else printf("%d\n",a);
return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <valarray>
#include <algorithm>
#include <time.h>
#include <cstdlib>
#include <iomanip>
#include <stdlib.h>

using namespace std;

int main (void)
{
	int a[4],b[4],A,B;

	for (int i = 0; i < 4; i++)
	{
		cin >> a[i];
		A += a[i];
	}

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

	if (A <= B)
	{
		cout << B - 1 << endl;
	}
	else if (A > B)
	{
		cout << A - 1 << endl;
	}
}

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;
}

return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define FOR(i,s,e) for(int i=s;i<e;i++)
#define RFOR(i,s,e) for(int i=s;i>=e;i--)

// vector<int> vec(N,0) →長さN,0初期化
// vec[i]→ iにアクセス、vec.push_back(x)　→末尾にxを追加
// vec.size()サイズ取得
// vec2d[20][10] == vector<<vectror<int>> vec2d(20, vector<int>(10,0))
#define SORT(vec) sort(vec.begin(),vec.end())
#define MAX(vec) *max_element(vec.begin(),vec.end())
#define MAXID(vec) distance(vec.begin(),max_element(vec.begin(),vec.end()))
#define MIN(vec) *min_element(vec.begin(),vec.end())
#define MINID(vec) distance(vec.begin(),min_element(vec.begin(),vec.end()))
#define NID(vec,n) distance(vec.begin(),find(vec.begin(),vec.end(),n))



int N,M;



int kitri(int a,int b,int c);

int main(){
	bool tri = true;
	int a,b,c,d;cin >> a >> b >> c >> d;
	int A,B,C,D;cin >> A >> B >> C >> D;
	int sum0 = a + b + c + d;
	int sum1 = A + B + C + D;
	if (sum0>sum1) cout << sum0 << endl;
	else cout << sum1 << endl;
	return 0;
}

int kitri(int a,int b,int c){
	if (pow(a,2) + pow(b,2) < pow(c,2)) return 0;
	if (pow(a,2) + pow(b,2) == pow(c,2)) return 1;
	if (pow(a,2) + pow(b,2) > pow(c,2)) return 2;
	else return 114514;
}

C++: #include<iostream>

using namespace std;

int main() {
	
	int A[5] = {};
	int B[5] = {};
	
	for(int i=0;i<4;i++) {
		
	cin >> A[i];
	A[4] += A[i];
	
}

	for(int i=0;i<4;i++) {
		
	cin >> B[i];
	B[4] += B[i];
	
}
	if( A[4] >= B[4] )
	cout << A[4] << "\n";
	
	else
	cout << B[4] << "\n";
	
	
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int a[4],b[4];
    int asum=0;
    int bsum=0;
    for (int i=0;i<4;++i){
        cin>>a[i];
        asum+=a[i];
    }
    for (int i=0;i<4;++i){
        cin>>b[i];
        bsum+=b[i];
    }
    if(asum>bsum){
        cout << asum<<endl;
    }
    else{
        cout <<bsum<< 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];
	}
}