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<set>
using namespace std;
#include<iostream>
int	main(){

/*	int N, C, c[100], n;
	cin >> N;
	C = 0;
	n = 0;

	for (int i = 0; i <N; i++ ){
		cin >> c[i];
		C+= c[i];
	}

	for (int i = 0; i <N; i++ ){
		if (c[i] <= 0.1*C){
			n+= 30;
		}
	}
	cout << n << endl;
}
	/*
	while(true){
	
	int A,B,C,D,E,F,G,H,I,J,answer;
		
	cin >> A;
	if(A == 0) return 0;
	cin >> B >> C >> D >> E >> F >> G >> H >> I >> J;
	answer = A - B - C - D-E-F-G-H-I-J;
	cout << answer << endl;

	}
	*/
	/*
	int A,B,C,D,E,F;

	cin >> A, B, C, D;
	if(A < B, C, D){ 
		cout << B + C + D << endl;
	}
	
	else if(B < A, C, D){
		cout << A + C + D << endl;
	}

	else if(C < A && C < B && C < D){
		cout << A + B + D << endl;
	}

	else if(D < A && D < B && D < C){
		cout << A + B + C << endl;
	}

	if(E < F){
		cout << F << endl;
	}

	else{
		cout << E << endl;
	}
	
	return 0;
}*/
	/*
	int N, M;
	cin >> N >> M;
	cout << N + M << endl << N - M << endl << N * M << endl << N / M << endl;
}*/

/*int N, M; 
	cin >> N >> M;
	cout << N % M << endl;
}*/

/*	int N;
	cin >> N;
	cout << -(N % 2)+1 ;
}*/

	/*int A, B, C, D, E ;
	cin >> A >> B >> C >> D >> E;
	cout << (A + B + C + D + E) / 5 ;
}*/

	/*int A, B, C, D ;
	cin >> A >> B >> C >> D;
	cout << (A + B + C + D) / 60 << endl << (A + B + C + D) % 60 << endl;
	*/

/*	int A,B;
	cin >> A >> B;
	cout << ( A + B ) / 2 << endl;*/

/*	int m, f, b;
	cin >> m >> f >> b;

	if ( m + f >= b && m <= b ){
		cout << b - m << endl;
	}
	
	if ( m + f > b && m > b ){
		cout << 0 << endl;
	}


	if ( m + f < b ){
		cout << "NA" << endl;
	}*/

/*	int X , x ;
	cin >> X ;

	x = X % 7 ;

	if ( x == 2 ){
		cout << "sat" << endl;
	}

	if ( x == 3 ){
		cout << "sun" << endl;
	}

	if ( x == 4 ){
		cout << "mon" << endl;
	}

	if ( x == 5 ){
		cout << "tue" << endl;
	}

	if ( x == 6 ){
		cout << "wed" << endl;
	}

	if ( x == 0 ){
		cout << "thu" << endl;
	}

	if ( x == 1 ){
		cout << "fri" << endl;
	}*/

	/*int a , b , N ;
	cin >> a >> b >> N ;

	int s[100] , f[100];
	for ( int i=0 ; i<N ; i++ ){
		cin >> s[i] >> f[i];
	
		if (( s[i] <= a && a < f[i]) || s[i] < b && b <= f[i] || s[i] >= a && f[i] <= b ){
			cout << 1 << endl;
			return 0;
		}
	}
	cout << 0 << endl;
	return 0;
}*/

	/*int N, A, B, C;
	vector <int> a;
	vector <int> dp;

	int pizza (int C){
		if (C == N) return 0;
		if (dp[C]! = -1) return dp[C];
		dp[C] = max (pizza(C+1); pizza(C+1)+a[C]);
		return dp[C];
	}

		int main(){
			cin >> N;
			for(int i = 0; i<N; i++){
				int tmp;
				cin >> tmp;
				a.push_back(tmp);
				dp.push_back(-1);
			}
			cout << pizza(0) << endl;

			return 0;
	}
		cout << C[i]/(A+B);*/
	
/*	int main(){
		int N, A, B, C, a, dp, i;

		dp[i+1] = max(dp[i], dp[i]+a[]), C[0] = 0;
	}*/

/*	long long N;
	cin >> N;
	cout << 264 + 52 * N << endl;
}*/

	/*int H, W;
	cin >> H >> W;
	if (H * 4 == W * 3){
		cout << "YOKO" << endl;
	}

	else{
		cout << "TATE" << endl;
	}


	}*/


	/*int X, Y;
	cin >> X >> Y;
	int m, n, l;
			cin >> m >> n >> l;
	X/Y == m/n;

	if (X/l == m && Y/l == n && l != 1){
			cout << l*(m+n)+2-(l-1) << endl;
	}

	else {
		cout << X+Y << endl;
	}*/

	int i, m, s, e, I, M, S, E;
	cin >> i >> m >> s >> e >> I >> M >> S >> E;

	if(i + m + s + e >= I + M + S + E){
		cout << i + m + s + e << endl;
	}

	else{
		cout << I + M + S + E << endl;
	}
}

C++: #include <iostream>

using namespace std;

int main(){
  int sumA=0,sumB=0;
  int ans=0;
  for(int i=0;i<8;i++){
    int num;cin>>num;
    if(i<4){
      sumA += num;
    }else{
      sumB += num;
    }
  }
  if(sumA<sumB) ans=sumB;
  else ans=sumA;
  cout<<ans<<endl;
}

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

#define for_(i,a,b) for(int i=a;i<b;++i)

int main() {
	int A = 0, B = 0;
	for_(i,0,4) {
		int a; scanf("%d", &a); A += a;
	}
	for_(i,0,4) {
		int b; scanf("%d", &b); B += b;
	}
	cout << max(A, B) << endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#define loop(i,n) for(int i=0;i<n;i++)
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;
for(int i=0;i<4;i++)
{
int q;
cin>>q;
a+=q;
}
for(int i=0;i<4;i++)
{
int q;
cin>>q;
b+=q;
}
if(a>b)cout<<a<<endl;
else cout<<b<<endl;


return 0;
}

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

using namespace std;

struct subject{
	int math;
	int info;
	int science;
	int eng;
};

int main(){
	
	subject A,B;
	cin >> A.info >> A.math >> A.science >> A.eng;
	cin >> B.info >> B.math >> B.science >> B.eng;
	cout << max(A.info+A.math+A.science+A.eng,B.info+B.math+B.science+B.eng) << endl;

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int A[4] = {0};
    int Asum = 0;
    int B[4] = {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 if(Asum < Bsum){
        cout << Bsum << endl;
    }
    return 0;
}

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

int main() {
    int sum_a = 0, sum_b = 0, tmp;
    for (int i = 0; i < 4; i++) {
        cin >> tmp;
        sum_a += tmp;
    }
    for (int j = 0; j < 4; j++) {
        cin >> tmp;
        sum_b += tmp;
    }
    cout << max(sum_a, sum_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;
}

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

int main()
{
    vector<int> sum_of_scores(2, 0);

    for (int i = 0; i < 2; i++)
        for (int a, b, c, d; cin >> a >> b >> c >> d;)
            sum_of_scores[i] = a + b + c + d;

    cout << max(sum_of_scores[0], sum_of_scores[1]) << endl;

    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#include<cstring>
#include<set>
#include<map>
#include<vector>
#include<cmath>
#include<queue>
#include<cstdio>
#include<cstdlib>
#define reep(n1,n2,n3) for(int n1=n3;n1<n2;n1++)
#define rep(n1,n2) reep(n1,n2,0)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define INF 1e9
using namespace std;
typedef long long int lint;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<pair<int,int> > vp;
typedef pair<int,int> pi;
typedef pair<int,pair<int,int> > pii;
typedef vector<string> vs;
const double PI  = acos(-1.0);
int main(){
    int s=0,t=0;
    rep(i,4){
        int a;
        cin>>a;
        s+=a;
    }
    rep(i,4){
        int a;
        cin>>a;
        t+=a;
    }
    cout<<(s>=t?s:t)<<endl;
}

C++: #include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <stack>
#include <vector>
#include <stdio.h>
using namespace std;

int a[2], b[2], c[2], d[2];



int main() {

	cin >> a[0] >> b[0] >> c[0] >> d[0] >> a[1] >> b[1] >> c[1] >> d[1];

	for (int i = 0; i < 2; i++) {
		a[i] += b[i] + c[i] + d[i];
	}
	cout << max(a[0], a[1]) << endl;

	return 0;
}