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

int main(){
  int a[4],b[4];
  int n=0;
  while(cin>>a[n]){
    n++;
    if(n==4)break;
  }

  n=0;

  while(cin>>b[n]){
      n++;
if(n==4)break;
    }
 int  A=a[0]+a[1]+a[2]+a[3];
 int  B=b[0]+b[1]+b[2]+b[3];
  if(A>B){
    cout << A << endl;
  }
if(A<B){
    cout << B << endl;
  }     
 if(A==B){
    cout << A << endl;
  }
    return 0;
}

C++: #include <stdio.h>

int main(void) {
    int a1, a2, a3, a4, b1, b2, b3, b4, S, T;

    scanf ("%d %d %d %d\n", &a1, &a2, &a3, &a4);    
    scanf ("%d %d %d %d\n", &b1, &b2, &b3, &b4);

    S = a1 + a2 + a3 + a4;
    T = b1 + b2 + b3 + b4;

    if (S > T) {
        printf ("%d\n", S);
    }
    else {
        printf ("%d\n", T);
    }

    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <stdio.h>
#include <bitset>
#include <limits.h>
#include <complex>
#include <deque>
#include <iomanip>
using namespace std;
#define MM 1000000000
#define MOD MM+7
#define pi pair<int32,int32>
#define pl pair<int64,int64>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define en cout << endl //セミコロンつけろ
const long double PI = acos(-1);
const long long INF = 1e15;
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
template<typename T>
T GCD(T u,T v){
    return v ? GCD(v,u%v) : u;
}
template<typename T>
T LCM(T x,T y){
    T gc = GCD(x,y);
    return x*y/gc;
}

long long pow_mod(long long n,long long k,long long m){
    if (k == 0){
        return 1;
    } else if (k % 2 == 1){
        return pow_mod(n,k-1,m)*n % m;
    } else {
        long long t = pow_mod(n,k/2,m);
        return t*t % m;
    }
}

set<int> st;
vector<int> v;

void dfs(int a){
    int sz = v.size();
    for(int i = 0; i < sz; i++){
        if (st.find(v[i] + a) == st.end()){
            st.insert(v[i]+a);
            v.push_back(v[i]+a);
        }
    }
    v.push_back(a);
}
int main(){
    int s[2] = {0};
    for(int i = 0; i < 2; i++){
        for(int j = 0; j < 4; j++){
            int a; cin >> a;
            s[i] += a;
        }
    }
    cout << max(s[0],s[1]) << endl;
}

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

int point,a,b;

int main (){
  a=0;
  b=0;
  for(int i=0;i<4;i++){
  scanf("%d"&point);
  a = a + point;
  }

  for(int i=0;i<4;i++){
    scanf("%d"&point);  
    b = b + point;
  }

  if(a>b){
    printf("%d",a)
  }
  else{
    printf("%d",b)
  }
}

C++: #include<stdio.h>

int main(){
	int a[4];
	int b[4];
	int s=0,t=0;
	scanf("%d %d %d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1],&b[2],&b[3]);
	for(int i=0;i<4;i++){
		s+=a[i];
		t+=b[i];
	}
	if(s>=t){
		printf("%d\n",s);
	}else{
		printf("%d\n",t);
	}
}

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

int main(){
	while(1){
	int sum1 = 0, sum2 = 0, a1, a2;	
	for(int i = 0; i < 4; i++){
		cin >> a1;
		sum1 += a1;
	}
	for(int i = 0; i < 4; i++){
		cin >> a2;
		sum2 += a2;
	}

	if(a1 >= a2){
		cout << sum1 << endl;
	}else{
		cout << sum2 << endl;
	}
	}

}

C++: #include <iostream>
int main(){int a,b,c,d,e;std::cin>>a>>b>>c>>d;e=a+b+c+d;std::cin>>a>>b>>c>>d;a=a+b+c+d;std::cout<<((a>e)?a:e)<<"\n";}

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

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

    for (auto &s : sum_of_scores) {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        s = 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<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	vector<int>in(2);
	rep(i,2){
		rep(j,4){
			int a;cin>>a;
			in[i]+=a;
		}
	}
	cout<<max(in[0],in[1])<<endl;
}

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++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
	int asum=0,bsum=0,a,b;
	for(int i=0;i<4;i++)
	{
		cin>>a;
		asum+=a;
	}
	for(int i=0;i<4;i++)
	{
		cin>>b;
		bsum+=b;
	}
	if(asum>bsum)
		cout<<asum<<endl;
	else
		cout<<bsum<<endl;
	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
#define INF 10000000


int main(){
	int sum1=0,a,sum2=0;
	REP(i,4){
		cin>>a;
		sum1+=a;
	}
	REP(i,4){
		cin>>a;
		sum2+=a;
	}
	cout<<max(sum1,sum2)<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define Rep(i,N) for(int i = 0; i < N; i++)
int main()
{
  int data;
  int sum = 0;
  int maxv = INT_MIN;
  Rep(p,2) {
    Rep(i,4) {
      cin >> data;
      sum += data;
    }
    maxv = max(maxv,sum);
    sum = 0;
  }
  cout << maxv << endl;
  return 0;
}