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 <cstdio>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define clear(v) memset(v,0,sizeof(v))
#define ALL(v) (v).begin(),(v).end()

int main(){
	int p[2][4];
	int sum[2] = {};
	rep(i, 2){
		rep(j, 4) cin >> p[i][j];
	}
	rep(i, 2){
		rep(j, 4) sum[i]+=p[i][j];
	}
	cout << ((sum[0] > sum[1]) ? sum[0] : sum[1]) << endl;
	return 0;
}

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

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>
#include<algorithm>
using namespace std;
int a[8];
int main(){
	for(int i=0;i<8;i++)cin>>a[i];
	cout<<max(a[0]+a[1]+a[2]+a[3],a[4]+a[5]+a[6]+a[7])<<endl;
	return 0;
}

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

int max(int a,int b){
	if(a>=b)return a;
	return b;
}

int main(){
	int a,b,c,d,s=0,t=0;
	scanf("%d%d%d%d",&a,&b,&c,&d);
	s=a+b+c+d;
	scanf("%d%d%d%d",&a,&b,&c,&d);
	t=a+b+c+d;
	printf("%d\n",max(s,t));
}

C++: using namespace std;

int main(){
	
	int answer;

	int s = 0, t = 0;
	int ibuf;

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

	answer = max(s, t);

	cout << answer << endl;

	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>>b>>c>>d>>e>>f>>g>>h;
   vector<int>v{a+b+c+d,e+f+g+h};
   sort(v.begin(),v.end());
   cout << v[1] << endl;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for (int i =0; i < (n); ++i)
using namespace std;

int main() {
        const int KM = 4;
        vector<int> A(KM);
        vector<int> B(KM);

        rep(i, KM) {
                cin >> A.at(i);
        }
        rep(i, KM) {
                cin >> B.at(i);
        }
        cout << max(accumulate(A.begin(), A.end(), 0), accumulate(B.begin(), B.end(), 0)) << endl;

        return 0;
}

C++: #include <iostream>
using namespace std;
int main (){
	int Info1,Math1,Science1,English1,Info2,Math2,Science2,English2,S,T;
		cin>>Info1>>Math1>>Science1>>English1;
			S=Info1+Math1+Science1+English1;
		cin>>Info2>>Math2>>Science2>>English2;
			T=Info2+Math2+Science2+English2;
				if(S>=T){
					cout<<S<<endl;
				}
				else {
					cout<<T<<endl;
				}
	return 0;
}

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

C++: #include <stdio.h>
int main(void)
{
    int Ascore[4],Bscore[4],i;
    for(i=0;i<4;i++)
        scanf("%d",&Ascore[i]);
    for(i=0;i<4;i++)
        scanf("%d",&Bscore[i]);
    Ascore[4]=Ascore[0]+Ascore[1]+Ascore[2]+Ascore[3];
    Bscore[4]=Bscore[0]+Bscore[1]+Bscore[2]+Bscore[3];
    if(Ascore[4]>Bscore[4])
        printf("%d\n",Ascore[4]);
    else
        printf("%d\n",Bscore[4]);
    return 0;
}

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

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector <string> VS;
typedef vector <int> VI;
typedef vector <VI> VVI;
template <class T> T gcd( T a, T b ) { return !b ? a : gcd( b, a % b ); }
template <class T> T lcm( T a, T b ){ return a / gcd( a, b ) * b; }
template <class T> string print_v( vector<T> v ) { OSS oss; for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++ it_i ) { oss << *it_i << ", "; } return oss.str(); }

int main() {
    int sa = 0, sb = 0;
    for ( int i = 0; i < 4; ++ i ) {
        int a;
        cin >> a;
        sa += a;
    }
    for ( int i = 0; i < 4; ++ i ) {
        int b;
        cin >>  b;
        sb += b;
    }
    cout << max( sa, sb ) << endl;
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int a, b, c, d = 0;
	int e, f, g, h = 0;
	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;
	}
	else if (a + b + c + d < e + f + g + h){
		cout << e + f + g + h << endl;
	}
	else if (a + b + c + d == e + f + g + h){
		cout << a + b + c + d << endl;
	}
	return 0;
}

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

int main(){
	int a[4];
	int b[4];
	int i=0;
	int s=0;
	int t=0;
	
	for(i=0;i<4;i++){
		cin>>a[i];
		s=s+a[i];
	}
	
	for(i=0;i<4;i++){  
		cin>>b[i];
		t=t+b[i];
	}
	
	if(s<t){
		cout<<t<<endl;
	}else{
		cout<<s<<endl;
	}
}

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

int main(void){

  int A[4],B[4],sumA=0,sumB=0;

  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 << max(sumA,sumB) << endl;

  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <functional>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <queue>

using namespace std;
#define loop(i,n) for(int i = 0; i < (n); ++i)
#define loops(i,f,n) for(int i = (f); i < (n); ++i)
#define all(v) v.begin(),v.end()
#define show(v) for(int i = 0; i < v.size(); ++i){cout<<i<<": "<<v[i]<<" "<<endl;}
#define enld endl
#define INF 999999999

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a=0, b=0;
	loop(i, 4)
	{
		int t;
		cin >> t;
		a += t;
	}
	loop(i, 4)
	{
		int t;
		cin >> t;
		b += t;
	}
	cout << max(a, b) << endl;
	return 0;
}

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

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

C++: #include<stdio.h>
int main(void)
{
	int zyo,suu,ri,ei;
	int zyo2,suu2,ri2,ei2;
	int s,t;
	s=0;
	t=0;
	
	scanf("%d %d %d %d",&zyo,&suu,&ri,&ei);
	scanf("%d %d %d %d",&zyo2,&suu2,&ri2,&ei2);
	s=zyo+suu+ri+ei;
	t=zyo2+suu2+ri2+ei2;
	if(s<=t){
		printf("%d\n",t);
	}
	else{
		printf("%d\n",s);
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int s,t,a;
int main(){
        for(int i = 0; i < 4; i++){
                cin >> a;
                s += a;
        }   
        for(int i = 0; i < 4; i++){
                cin >> a;
                t += a;
        }   
        cout << max(s,t) << endl;
}