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<stdio.h>
#include<stdlib.h>

int main(){
  int a1,b1,c1,d1,a2,b2,c2,d2,s,t;

  scanf("%d %d %d %d",&a1,&b1,&c1,&d1);
  scanf("%d %d %d %d",&a2,&b2,&c2,&d2);

  s=a1+b1+c1+d1;
  t=a2+b2+c2+d2;

  if(s == t){
    printf("%d\n",s);
  }
  else if(s > t){
    printf("%d\n",s);
  }
  else{
    printf("%d\n",t);
  }

  return 0;
}

C++: #include<string>
#include<cstdio>
#include<cctype>
#include<iostream>
#include <algorithm>
#include<cmath>
#include<queue>
using namespace std;

int main(){
    int a[8]={0},b[8]={0};
    cin >>a[1]>>a[2]>>a[3]>>a[4];
    a[5]=a[1]+a[2]+a[3]+a[4];
    cin >>b[1]>>b[2]>>b[3]>>b[4];
    b[5]=b[1]+b[2]+b[3]+b[4];
    if(a[5]>b[5])cout <<a[5]<<endl;
    else cout <<b[5]<<endl;
    return 0;
}

C++: #include <stdio.h>
int main()
{
	int i,a[4],b[4],a_total=0,b_total=0,put;
	for(i=0;i<4;i++)
	{
		scanf("%d",&a[i]);
		a_total+=a[i];
	}
	for(i=0;i<4;i++)
	{
		scanf("%d",&b[i]);
		b_total+=b[i];
	}
	put=a_total<b_total?b_total:a_total;
	printf("%d\n",put);
	//Sleep(1000);
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int a[4],b[4],d,k;
    for(int i=0;i<4;i++){
        cin>>a[i];
    }
    for(int i=0;i<4;i++){
        cin>>b[i];
    }
    d=a[0]+a[1]+a[2]+a[3];
    k=b[0]+b[1]+b[2]+b[3];
    if(d>k){cout<<d<<endl;}
    if(d<k){cout<<k<<endl;}
    if(d==k){cout<<d<<endl;}

}

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

int main()
{
 int a1,b1,c1,d1,a2,b2,c2,d2,x,y;
 cin>>a1>>b1>>c1>>d1;
 cin>>a2>>b2>>c2>>d2;
 x=a1+b1+c1+d1;
 y=a2+b2+c2+d2;

 if(x>=y)cout<<x<<"\n";
 else cout<<y<<"\n";

 return 0;
}

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

#define pb push_back
#define fr first
#define sc second
typedef pair<int,int> pii;
typedef vector<int> vi;
const int INF = (1<<25);
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
  int a[4],b[4];
  int asum=0,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;
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

int main()
{
    int s=0,a,t=0,b;
    REP(4){cin >> a; s+=a;}
    REP(4){cin >> b; t+=b;}
    cout << max(s,t) << endl;
    return 0;
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef pair<int, int> P;
typedef long long ll;

const int INF = 1 << 30;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

bool leap(int y)
{
	return ((y%4==0&&y%100!=0)||y%400==0);
}

#define debug(a, b, c) for(int i = 0; i < b; i++){for(int j = 0; j < c; j++){printf("%3d", a[i][j]);}puts("");}puts("-----------------------------------------");

int main()
{
	int a = 0, b = 0, wk;
	for(int i = 0; i < 4; i++)
	{
		cin >> wk;
		a += wk;
	}
	for(int j = 0; j < 4; j++)
	{
		cin >> wk;
		b += wk;
	}
	if(a == b)
		printf("S");
	else
		printf("%d", (a > b)? a: b);
}

C++: #include<iostream>
using namespace std;
	int main(){
	int sum1=0,sum2=0;int a;
	for(int i=0;i<4;i++){
	cin>>a;
	sum1+=a;
}
for(int i=0;i<4;i++){
	cin>>a;
	sum2+=a;
}
	if(sum1>sum2)cout<<sum1;
	else if(sum1<sum2)cout<<sum2;
	else cout<<sum1;

return 0;
}

C++: #include <cstdio>
main(){
	int a[4],b[4],ar,br;
	scanf("%d%d%d%d",a,a+1,a+2,a+3);
	scanf("%d%d%d%d",b,b+1,b+2,b+3);
	ar=*a+a[1]+a[2]+a[3],br=*b+b[1]+b[2]+b[3];
	printf("%d\n",ar>br?ar:br);
}

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

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

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

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

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

int a[4], b[4];
int main()
{
  for(int i = 0; i < 4; i++)
    cin >> a[i];
  for(int i = 0; i < 4; i++)
    cin >> b[i];

  int s = 0, t = 0;
  for(int i = 0; i < 4; i++)
    s += a[i];
  for(int i = 0; i < 4; i++)
    t += b[i];

  cout << max(s, t) << endl;
  return 0;
}

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

int main(){
    int a[4];
    int b[4];

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

    for(int i=1; i<=3; i++){
        a[0] += a[i];
        b[0] += b[i];
    }

    if(a[0] > b[0]){
        cout << a[0] << endl;
    }else{
        cout << b[0] << endl;
    }

    return 0;
}

C++: a,b,c;main(i)
{
	scanf("%d",&c);
	(i<5?a:b)+=c;
	i-8?main(i+1):printf("%d\n",a>b?a:b);
}

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

C++: #include <bits/stdc++.h>
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>
using namespace std;
int main()
{
  int sumA = 0,sumB = 0;
  int A[4] = {};
  int B[4] = {};

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

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

  cout << ((sumA > sumB) ? sumA : sumB) << endl;

  return 0;
}

C++: #include <stdio.h>
#include <cctype>
#include <limits.h>
#include <math.h>
#include <complex>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x);
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))

const int INF = 1000000000;
const double EPS = 1e-8;
const double PI = 3.14159;
int dx[4]={-1, 0, 1, 0}, dy[4]={0, -1, 0, 1};
using namespace std;
typedef pair<int, int> P;

/** Problem0510 : Score **/
int main()
{
	int A=0, B=0;
	rep(i, 4) {
		int a;
		cin>>a;
		A+=a;
	}
	rep(i, 4) {
		int a;
		cin>>a;
		B+=a;
	}
	cout << max(A, B) << endl;
}