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 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>
#include<algorithm>
using namespace std;

int main()
{
	int sum=0, summ=0;
	for (int i = 0; i < 4; i++)
	{
		int s; cin >> s; sum += s;
	}
	for (size_t i = 0; i < 4; i++)
	{
		int s; cin >> s; summ += s;
	}
	if (sum >= summ) { cout << sum<<endl; }
	else { cout << summ<<endl; }
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main() {
	cin.tie(0);ios::sync_with_stdio(false);
	int A = 0, 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;
	}
	cout << max(A, B) << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <queue>
#include <stack>
#include <set>

using namespace std;

#define ALL(co) co.begin(), co.end()
#define tpl(...) make_tuple(__VA_ARGS__)

typedef long long LL;
typedef pair<int, int> P; typedef pair<int, P> IP; typedef pair<P, P> PP;
typedef vector<int> Array; typedef vector<vector<int> > Array2;
typedef vector<LL> LArray; typedef vector<P> PArray; typedef vector<string> SArray;

const int INF = 1 << 29;
const LL LINF = 1LL << 60;

inline int getInt() { int itiv; return (cin >> itiv, itiv); }
template <typename T> void readAll(vector<T>& vec) { for (int i = 0, size = vec.size(); i < size; i++) cin >> vec[i]; }
template <typename T, typename U> void readAll(vector<pair<T, U> >& vec) { for (int i = 0, size = vec.size(); i < size; i++) cin >> vec[i].first >> vec[i].second; }
template < typename T > inline string toString( const T &a ){ ostringstream oss; oss << a; return oss.str(); };
inline bool between(int min, int max, int n) { return min <= n && n <= max; }
inline bool inRange(int begin, int end, int n) { return begin <= n && n < end; }
inline bool inRange(int size, int n) { return 0 <= n && n < size; }

int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, -1, 0, 1 };
int dr[] = { 0, -1, 0, 1 }, dc[] = { -1, 0, 1, 0 };

int m, n;

int main(void)
{
	ios::sync_with_stdio(false);
	Array a(4), b(4);
	readAll(a);
	readAll(b);
	cout << max(accumulate(ALL(a), 0),accumulate(ALL(b), 0)) << endl;
	return 0;
}

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


int main(){
  int a,b,c,d,totala=0,totalb=0;
  cin>>a>>b>>c>>d;
  totala=a+b+c+d;
  cin>>a>>b>>c>>d;
  totalb=a+b+c+d;
  if(totala>totalb){
    cout<<totala<<endl;
  }else if(totala<totalb){
    cout<<totalb<<endl;
  }else if(totala==totalb){
    cout<<totala<<endl;
  }


  return 0;
}

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

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

int main(){
    scanf("%d %d %d %d\n%d %d %d %d", &a, &b, &c, &d, &e, &f, &g, &h);
    if(a + b + c + d <= e + f + g + h){
        printf("%d", e + f + g + h);
    }else{
        printf("%d", a + b + c + d);
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a1, a2, a3, a4, b1, b2, b3, b4;
	cin >> a1 >> a2 >> a3 >> a4 >> b1 >> b2 >> b3 >> b4;
	cout << max(a1 + a2 + a3 + a4, b1 + b2 + b3 + b4) << endl;
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <ctime>
#include <vector>
#include <stack>

using namespace std;
////////////////*My library*////////////////////////
#define rep_to(a,i,n) for(int i=a;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_r(i,n) for(int i=n-1;i>=0;i--)
#define debug(x) cout<<x<<endl
#define s_1(x) cin>>x
#define s_2(x,y) cin>>x>>y
////////////////////////////////////////////////////

////////////////////////
/*prime()*/
/*primecount()*/
/*sort()*/
/*imos???*/
/*????????¢?´¢*/
/*??±???????????¢?´¢*/
/*???????¨???????*/
///////////////////////

int main()
{
	int N;
	int a,b,c,d;
	int sumA=0,sumB=0;

	rep(i,2)
	{
		cin>>a>>b>>c>>d;
		if(i==0)sumA=a+b+c+d;
		else sumB=a+b+c+d;
	}

	if(sumA>=sumB)cout<<sumA<<endl;
	else if(sumA<sumB)cout<<sumB<<endl;

	return 0;
}

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