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<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<set>
 
#include<stdio.h>
 
using namespace std;
 
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define pb push_back
#define read(a) scanf("%d",&(a))
#define write(a) printf("%d",(a))
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;
int main() {
	int a[4],b[4];
	rep(i,4) read(a[i]);
	rep(i,4) read(b[i]);
	int suma=0, sumb=0;
	rep(i,4) suma+=a[i];
	rep(i,4) sumb+=b[i];
	write(max(suma,sumb));
	printf("\n");
}

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

using namespace std;

int main(){
	/*
	int n;
	cin >> n;
	int p[200][3];

	for(int i=0;i<n;i++)
	{
		cin >> p[i][0] >> p[i][1] >> p[i][2];
	}

	int _p;
	for(int k=0;k<3;k++)
	{
		for(int i=0;i<n;i++)
		{
			_p = p[i][k];
			for(int j=i+1;j<n;j++)
			{
				if(_p == p[j][k])
				{
					p[i][k] = 0;
					p[j][k] = 0;
				}
			}
		}
	}

	for(int i=0;i<n;i++)
	{
		cout << p[i][0] + p[i][1] + p[i][2] << endl;
	}
	*/

	int ai,am,as,ae,bi,bm,bs,be;
	cin >> ai >> am >> as >> ae >> bi >> bm >> bs >> be;
	int answer=ai+am+as+ae;
	if(answer < bi+bm+bs+be)
	{
		answer=bi+bm+bs+be;
	}
	cout << answer << endl;

	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int a, b, c, d, ans = 0;
  while(cin >> a >> b >> c >> d) ans = max( ans, a + b + c + d);
  cout << ans << endl;
}

C++: #include<cstdio>
using namespace std;
int main(void)
{
   int a = 0,b = 0,c;
   for(int i = 0;i < 4;i++)
   {
      scanf("%d",c);
      a += c;
   }
   
   for(int i = 0;i < 4;i++)
   {
      scanf("%d",c);
      b += c;
   }
   if(a>b) printf("%d\n",a);
   else printf("%d\n",b);
   return 0;
}

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

int main(){
	int S=0, T=0, n;
	for( int i=0; i<8; i++ ){
		cin >> n;
		(i/4?T:S) += n;
	}
	cout << (S>T?S:T) << endl;
	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[3],b[3],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 a=0,b=0;
	for(int i=0;i<4;i++){
		int t;
		cin>>t;
		a+=t;
	}
	for(int i=0;i<4;i++){
		int t;
		cin>>t;
		b+=t;
	}
	cout<<max(a,b)<<endl;
}

C++: // Example program
#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;
int main()
{
 int a;
 int b;
 int c;
 int d;
 int e;
 int f;
 int g;
 int h;
 cin >> a;
 cin >> b;
 cin >> c;
 cin >> d;
 cin >> e;
 cin >> f;
 cin >> g;
 cin >> h;
 
 int s; 
 int t;
 s=(a+b+c+d);
 t=(e+f+g+h);
 
 if(s<t){cout << "t" << endl};
 if(t<s){cout << "s" << endl};
 if(s==t){cout << "t" << endl};
}

C++: #include <iostream>
using namespace std;
int main(void){
    int total_a=0, total_b=0, a, b;
    for(int i=1; i<=4; i++){
        cin >> a;
        total_a += a;
    }
    for(int i=1; i<=4; i++){
        cin >> b;
        total_b += b;
    }
    if(total_a >= total_b) cout << total_a << endl;
    else cout << total_b << endl;
    return 0;
    
}

C++: #include<iostream>

using namespace std;

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

  if(sum1 > sum2) cout << sum1;
  else cout << sum2;

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int sum[2],T,a,b,c,d;
	for(int i=0;i<2;++i){
		cin>>a>>b>>c>>d;
		sum[i]=a+b+c+d;
	}
	cout<<max(sum[0],sum[1])<<endl;
	return 0;
}

C++: #include <iostream>

using namespace std;
int main(void) {
	int a1, a2, a3, a4, S;
	int b1, b2, b3, b4, T;
	cin >> a1 >> a2 >> a3 >> a4;
	cin >> b2 >> b2 >> b3 >> b4;
	S = a1 + a2 + a3 + a4;
	T = b1 + b2 + b3 + b4;

	if (S > T) cout << S << endl;
	else if (S == T) cout << S << "(=T)" << endl;
	else cout << T << endl;


	return 0;
}

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

int main()
{
    int s[2], u;
    for(int k = 0; k < 2; k++) {
        s[k] = 0;
        for(int i = 0; i < 4; i++) {
            cin >> u;
            s[k] += u;
        }
    }

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

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

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

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

int main() {
    int a[4],b[4];
    for(int i=0;i<4;i++) scanf("%d",&a[i]);
    for(int i=0;i<4;i++) scanf("%d",&b[i]);
    
    int as=std::accumulate(a,a+4, 0), bs=std::accumulate(b,b+4, 0);
    as < bs ? std::cout << as : std::cout << bs;
    
    return 0;
}

C++: #include <iostream>

using namespace std;

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

	return 0;
}