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>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    int s = 0;
    int t = 0;

    for(int i=0; i<4; ++i){
        int a;
        cin >> a;
        s += a;
    }
    for(int i=0; i<4; ++i){
        int a;
        cin >> a;
        t += a;
    }

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

C++: #include <iostream>
using namespace std;
int main(void){
    int a,b,c,d;
    int e,f,g,h;
    cin>>a>>b>>c>>d;
    cin>>e>>f>>g>>h;
    int x=a+b+c+d;
    int y=e+f+g+h;
    if(x>y){
        cout<<x<<endl;
    }
    else{
        cout<<y<<endl;
    }
     
}

C++: #include<stdio.h>
int main(void)
{
	int a,a1,a2,a3,b,b1,b2,b3;
	scanf("%d %d %d %d",&a,&a1,&a2,&a3);
	scanf("%d %d %d %d",&b,&b1,&b2,&b3);
	if(a+a1+a2+a3>=b+b1+b2+b3)	printf("%d\n",a+a1+a2+a3);
	else	printf("%d\n",b+b1+b2+b3);
	return 0;
}

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()
{
	int i,j,s,t,a[4],b[4];
	for(j=0;j<2;j++)
	{
		for(i=0;i<4;i++)
		{
			if(j==0)
			{
				cin>>a[i];
				s=a[i]+s;
			}
			else
			{
				cin>>b[i];
				t=b[i]+t;
			}
		}
	}
	if(t<s)
	{
	 cout>>s>>endl;
	}
	else
	{
	cout>>t>>endl;
	}	
	return 0;
}

C++: #define _USE_MATH_DEFINES
#define INF 100000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

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

static const double eps = 1e-8;

int main(){

	int res=0;
	for(int i=0;i<2;i++){
		int sum = 0;
		for(int j=0;j<4;j++){
			int p;
			scanf("%d",&p);
			sum += p;
		}
		res = max(sum,res);
	}

	printf("%d\n",res);
}

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

int main(){
    int s=0, t=0;
    int n=4;
    while(n--){ int a; cin>>a; s+=a; };
    n=4;
    while(n--){ int a; cin>>a; t+=a; };
    cout<<(s>t ? s : t)<<endl;
}

C++: #include <cstdio>

int main(){
	int i,a,b,c;
	for(a=b=i=0;i<8;i++)
		scanf("%d",&c),i<4?a+=c:b+=c;
	printf("%d\n",(a>b)?a:b);
}

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

using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;(i)>=0;(i)--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())

typedef long long ll;

int main(){

    int A[4];
    int B[4];
    REP(i,4)cin>>A[i];
    REP(i,4)cin>>B[i];
    
    int a=0,b=0;
    REP(i,4){
        a+=A[i];
        b+=B[i];
    }
    
    cout<<max(a,b)<<endl;
    
    return 0;
    
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b,c,d,e,f,g,h;
  cin >> a >> b >> c >> d >> e >> f >> g >> h;
  cout << max(a+b+c+d,e+f+g+h) << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int ans,s=0,t=0;
    for(int i=0;i<4;++i){
        scanf("%d",&ans);
        s+=ans;
    }
    for(int i=0;i<4;++i){
        scanf("%d",&ans);
        t+=ans;
    }
    if(s >= t){
        printf("%d\n",s);
    }else if(s <= t){
        printf("%d\n",t);
    }
    return 0;
}

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

int main(void){
	int tmp, a, b;
	a = b = 0;
	for(int i = 0; i < 8; i++){
		cin >> tmp;
		if(i < 4)
			a += tmp;
		else
			b += tmp;
	}
	cout << ((a >= b)? a : b) << endl;
	return 0;
}

C++: #include<stdio.h>
int main(){
	int a,b,c,d,e,f,g,h,s,t;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	scanf("%d %d %d %d",&e,&f,&g,&h);
	 s = a+b+c+d;
	 t = e+f+g+h;
	 if(s>=t){
	 	printf("%d",s);
	 }else if(s<t){
	 	printf("%d",t);
	 }
	 return 0;
}

C++: //include
//------------------------------------------
#include <bits/stdc++.h> // only for GCC

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

//repetition
//------------------------------------------
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

// output vector
// ------------------------------------------
namespace std {
    template<typename T>ostream&operator<<(ostream&os, vector<T>const&v){
        iter(it,v) os<<*it<<(it+1==v.end()?"":",");
        return os;
    }
    template<typename T, typename U>ostream&operator<<(ostream&os,const pair<T,U>&p){
        return os << "[" << p.dirst << "," << p.second << "]";
    }
}

//clear memory
// ------------------------------------------
#define clr(a,i) memset((a), (i) ,sizeof(a))

int main(){
   vi a(4),b(4);
   rep(i,4)cin>>a[i];
   rep(i,4)cin>>b[i];
   if(accumulate(all(a),0)>accumulate(all(b),0)) cout << accumulate(all(a),0) <<endl;
   else cout << accumulate(all(b),0) <<endl;
}

C++: #include<iostream>
using std::cout;
using std::cin;
using std::endl;

int main(){
	int tmp,S=0,T=0;
	for(int i9; i<4; i++){
		cin >> tmp;
		S+=tmp;
	}
	for(int i9; i<4; i++){
		cin >> tmp;
		T+=tmp;
	}
	if(S>T)
		cout << S << endl;
	else
		cout << T << endl;
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,e,f,g,h;
    cin>>a>>b>>c>>d>>e>>f>>g>>h;
    if(a+b+c+d>e+f+g+h)
    cout<<a+b+c+d<<endl;
    else if(a+b+c+d<e+f+g+h)
    cout<<e+f+g+h<<endl;
    else 
    cout<<a+b+c+d<<endl;
}

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