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 <algorithm>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;

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

int main(){
	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 cout<<e+f+g+h;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <windows.h>
#include <iostream>
#include <algorithm>
#include <set>
#include <queue>
#include <functional>

using namespace std;

typedef unsigned int uint;
typedef long long int llint;
typedef pair<llint,llint> pii;

#define mpq(T) priority_queue<T,vector<T>,greater<T> >
#define FOR(i,a,b) for(int i = (a),i < (b); i++)
#define REP(i,a) for(int i = 0; i < (a); i++)

class BIT
{
private:
	int s;
	llint* d;
public:
	BIT(int size)
	{
		s = size;
		d = (llint*)malloc(sizeof(llint) * s);
		for(int i = 0; i < s; i++)
		{
			d[i] = 0;
		}
	}

	void add(int b,int x)
	{
		for(int i = b + 1; i <= s; i += (i & -i))
		{
			d[i - 1] += x;
		}
	}

	llint sum(int b)
	{
		llint all = 0;
		for(int i = b + 1; i > 0; i -= (i & -i))
		{
			all += d[i - 1];
		}
		return all;
	}

	~BIT()
	{
		free(d);
	}
};

class unionfind
{
private:
	int s;
	int* o;
	int* r;
public:
	unionfind(int dsize)
	{
		s = dsize;
		o = (int*)malloc(sizeof(int) * s);
		r = (int*)malloc(sizeof(int) * s);
		for(int i = 0; i < s; i++)
		{
			o[i] = i;
			r[i] = 0;
		}
	}

	int mfind(int b)
	{
		if(o[b] != b)
		{
			o[b] = mfind(o[b]);
		}
		return o[b];
	}

	void munion(int a,int b)
	{
		int aw = mfind(a);
		int bw = mfind(b);
		if(aw == bw)
		{
			return;
		}
		if(r[aw] > r[bw])
		{
			o[bw] = a;
		}
		else if(r[aw] < r[bw])
		{
			o[aw] = bw;
		}
		else
		{
			o[bw] = aw;
			r[aw]++;
		}
		s--;
	}

	int size()
	{
		return s;
	}

	~unionfind()
	{
		free(o);
		free(r);
	}
};

template<class T> int lbound(T* d,T key,int s,int e)
{
	s--;
	while(e - s > 1)
	{
		int m = (s + e) / 2;
		if(d[m] < key)
		{
			s = m;
		}
		else
		{
			e = m;
		}
	}
	return e;
}

template<class T> int ubound(T* d,T key,int s,int e)
{
	s--;
	while(e - s > 1)
	{
		int m = (s + e) / 2;
		if(key < d[m])
		{
			e = m;
		}
		else
		{
			s = m;
		}
	}
	return e;
}

class zpress
{
private:
	int ms;
	pii* md;
	int n;
	int s;
	llint* d;
	int* t;
public:
	zpress(int dsize = 1000000)
	{
		int ms = dsize;
		md = (pii*)malloc(sizeof(pii) * ms);
		d = (llint*)malloc(sizeof(llint) * ms);
		t = (int*)malloc(sizeof(int) * ms);
		n = 0;
	}

	void in(llint x)
	{
		in2(x,n);
		n++;
	}

	void in2(llint x,int b)
	{
		md[b] = make_pair(x,b);
	}

	void syori()
	{
		syori2(n);
	}

	void syori2(int k)
	{
		sort(md,md + k);
		llint mae = LLONG_MIN;
		s = 0;
		REP(i,k)
		{
			if(md[i].first != mae)
			{
				d[s] = md[i].first;
				s++;
				mae = md[i].first;
			}
			t[md[i].second] = s - 1;
		}
	}

	llint iti(int b)
	{
		return t[b];
	}

	int size()
	{
		return s;
	}

	int first(llint x)
	{
		return lbound(d,x,0,s);
	}

	int end(llint x)
	{
		return ubound(d,x,0,s);;
	}

	~zpress()
	{
		free(md);
		free(d);
		free(t);
	}
};

class xorshift
{
private:
	unsigned int a,b,c,d;
public:
	xorshift(unsigned int aw = 123456789,unsigned int bw = 362436069,unsigned int cw = 521288629,unsigned int dw = 88675123,unsigned int e = 97)
	{
		a = aw;
		b = bw;
		c = cw;
		d = dw;
		for(unsigned int i = 0; i < e; i++)
		{
			operator()();
		}
	}

	unsigned int operator()()
	{
		unsigned int w = a ^ (a << 11);
		a = b;
		b = c;
		c = d;
		d = (d ^ (d >> 19)) ^ (w ^ (w >> 8));
		return d;
	}
};

llint gcd(llint a,llint b)
{
	while(1)
	{
		llint w = a % b;
		if(w == 0)
		{
			return b;
		}
		a = b;
		b = w;
	}
}

llint sei(llint d,llint p)
{
	if(d < 0)
	{
		d -= ((d + 1) / p - 1) * p;
	}
	else
	{
		d %= p;
	}
	return d;
}

llint inv(llint a,llint p)
{
	llint r0 = sei(a,p);
	llint r1 = p;
	llint a0 = 1;
	llint b0 = 0;
	llint a1 = 0;
	llint b1 = 1;
	while(1)
	{
		llint q = r0 / r1;
		llint w = r0 - q * r1;
		if(w == 0)
		{
			break;
		}
		r0 = r1;
		r1 = w;
		w = a0 - q * a1;
		a0 = a1;
		a1 = w;
	}
	return sei(a1,p);
}

template <llint P> class mod
{
private:
	llint d;
public:
	mod(llint a = 0)
	{
		d = a;
		d = sei(d,P);
	}

	mod operator-() const
	{
		return mod(P - d);
	}

	mod operator+=(const mod& a)
	{
		d = d + a.d;
		d = sei(d,P);
		return *this;
	}

	mod operator-=(const mod& a)
	{
		return operator+=(-a);
	}

	mod operator*=(const mod& a)
	{
		d = d * a.d;
		d = sei(d,P);
		return *this;
	}

	mod operator/=(const mod& a)
	{
		return a * mod(inv(d,P));
	}

	mod operator+(const mod& a) const
	{
		mod w = *this;
		return (w += a);
	}

	mod operator-(const mod& a) const
	{
		mod w = *this;
		return (w -= a);
	}
	
	mod operator*(const mod& a) const
	{
		mod w = *this;
		return (w *= a);
	}

	mod operator/(const mod& a) const
	{
		mod w = *this;
		return (w /= a);
	}
	
	bool operator==(const mod& a) const
	{
		return (d == a.d);
	}

	bool operator!=(const mod& a) const
	{
		return (d != a.d);
	}

	operator llint() const
	{
		return d;
	}
};

/////////////////////////////////////////////////////

FILE* fi;
FILE* fo;

void err(char* a)
{
	printf("%s\n",a);
	getchar();
}

llint in()
{
	llint w;
	fscanf_s(fi,"%lld",&w);
	return w;
}

void ins(char* a)
{
	fscanf_s(fi,"%s",a);
}

void out(llint a)
{
	fprintf_s(fo,"%lld\n",a);
}

void outs(char* a)
{
	fprintf_s(fo,"%s\n",a);
}

void func();

int main()
{
	func();
	return 0;
}

void func()
{
	int a = 0;
	REP(i,4)
	{
		a += in();
	}
	int b = 0;
	REP(i,4)
	{
		b += in();
	}
	out(max(a,b));
}

C++: #include <iostream>
using namespace std;
int main()
{

	int t[2], tp[2][4];

	for (int i = 0; i < 2; i++){
		t[i] = 0;
		for (int j = 0; j < 4; j++){
			cin >> tp[i][j];
			t[i] += tp[i][j];
		}
	}
	if (t[0]>=t[1]) cout << t[0] << endl;
	else cout << t[1] << endl;

}

C++: #include <iostream>

using namespace std;

int main() {
	int A, B;
	int A1, A2, A3, A4;
	int B1, B2, B3, B4;
	cin >> A1 >> A2 >> A3 >> A4;
	A = A1 + A2 + A3 + A4;
	cin >> B1 >> B2 >> B3 >> B4;
	B = B1 + B2 + B3 + B4;

	cout << (A>B?A:B) << endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{int a,b,c,d,e,f,g,h,S,T;
cin>>a>>b>>c>>d>>e>>f>>g>>h;
 S=a+b+c+d;
 T=e+f+g+h;
 if(S>=T){
    cout<<S<<endl;
 }
 else{
    cout<<T<<endl;
 }
    return 0;
}

C++: //
//  main.cpp

#include <iostream>
using namespace std;


int main(){
	int a,b,c,d,A,B,C,D;
	cin >> a >> b >> c >> d >> A >> B >> C >> D;
	cout << max(a+b+c+d,A+B+C+D) << 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,b,c,d;
int e,f,g,h;

scanf("%d %d %d %d",&a,&b,&c,&d);

scanf("%d %d %d %d",&e,&f,&g,&h);

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

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

int main() {
	int p[2]={};
	int n;
	for(int i=0;i<2;i++){
	for(int j=0;j<4;j++){
		cin >> n;
		p[i]+=n;
	}
	}
	cout << max(p[0],p[1]) << endl;
	return 0;
}