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>
int main(void)
{
	int a,b,i,j,s,ss;
	s=0;
	for(i=0;i<4;i++){
		scanf("%d",&a);
		s+=a;
	}
	ss=0;
	for(j=0;j<4;j++){
		scanf("%d",&b);
		ss+=b;
	}
	if(s>=ss){
		printf("%d\n",s);
	}
	else if(s<ss){
		printf("%d\n",ss);
	}
	return 0;
}

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

int main()
{
	int a,b,s=0,t=0;
	for(int i=1; i<=4; i++){
		cin>>a;
		s+=a;
		}
	for(int i=1; i<=4; i++){
		cin>>b;
		t+=b;
		}
	if(s>=t)
		cout<<s;
	else
		cout<<t;
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
	int a,b,asum=0,bsum=0;
	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<iostream>
using namespace std;

int main(){
	int a, b, c, d, e, f, g, h;
	cin >> a >> b >> c >> d >> e >> f >> g >> h;
	int suma = a+b+c+d, sumb = e+f+g+h;

	if(suma >= sumb){
		cout << suma << endl;
	}else{
		cout << sumb << endl;
	}

	return 0;
}

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

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

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

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

C++: #include<iostream>
using namespace std;
int main(){
int a[4],b[4],sum_a,sum_b;

cin>>a[0]>>a[1]>>a[2]>>a[3];
cin>>b[0]>>b[1]>>b[2]>>b[3];
sum_a=a[0]+a[1]+a[2]+a[3];
sum_b=b[0]+b[1]+b[2]+b[3];

if(sum_a>=sum_b){
cout<<sum_a<<endl;
}else{
cout<<sum_b<<endl;
}

return 0;
}

C++: #include <iostream>
#include <algorithm>

int main() {
	int a[4] = {}, b[4] = {};
	std::cin >> a[0] >> a[1] >> a[2] >> a[3];
	std::cin >> b[0] >> b[1] >> b[2] >> b[3];
	std::cout << std::max({ a[0] + a[1] + a[2] + a[3], b[0] + b[1] + b[2] + b[3] }) << std::endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int a, b, c, d;
	int max = 0;
	for (int i = 0; i < 2; ++i) {
		cin >> a >> b >> c >> d;
		int sum = a + b + c + d;
		if (sum > max) max = sum;
	}
	cout << max << endl;
	return 0;
}

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<<endl;
	else if(sum1<sum2)cout<<sum2<<endl;
	else cout<<sum1<<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;
cin>>e>>f>>g>>h;
S=a+b+c+d;
T=e+f+g+h;
if(S>=T) cout<<"S\n";
if(S<T) cout<<"T\n";

return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int point[4],i,sum[2],max=0;
	
	sum[0]=0;
	sum[1]=0;

	for (i=0;i<2;i++) {
		scanf("%d %d %d %d",&point[0],&point[1],&point[2],point[3]);
		sum[i]+=point[0]+point[1]+point[2]+point[3];
		if(max < sum[i]) {
			max=sum[i];
		}
	}

	printf("%d\n",max);

	return 0;
}

C++: #include<iostream>
using namespace std;
int i, n, pA, pB, tA = 0, tB = 0;
int main() {
    while(cin >> n) {
        if(n == 0) { break; }
        for (i=1; i<=n; i++) {
            cin >> pA >> pB;
            if (pA >pB) {
                tA += pA + pB;
            } else {
                if (pA < pB) {
                    tB += pA + pB;
                } else {
                    tA += pA;
                    tB += pB;
                }
            }
         }
         cout << tA << " " << tB << endl;
         tA = 0; tB = 0;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <list>
#include <math.h>
#include <algorithm>


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++: #include <iostream>
using namespace std;

int main()
{
  int p[2] = {0}, 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);
}

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

C++: #include <stdio.h>

int main(){
    int a[4],b[4],i,A,B;
    A=0;
    B=0;
    for (i=0;i<4;i++) {
        scanf("%d",&a[i]);
        A+=a[i];
    }
    for (i=0;i<4;i++) {
        scanf("%d",&b[i]);
        B+=b[i];
    }
    if (A>=B) {printf("%d\n",A);}
    else {printf("%d\n",B);}
    return 0;
}

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

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

int a, s, t;

int main(){
	REP(i, 8){
		cin >> a;
		(i < 4) ? s += a : t += a;
	}
	cout << max(s, t) << endl;
}

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

int main(void) {
    int a, b, c, d, p, q, r, s;
    cin >> a >> b >> c >> d;
    cin >> p >> q >> r >> s;

    int sum1 = a + b + c + d;
    int sum2 = p + q + r + s;
    
    if (sum1 > sum2)
		cout << sum1 << endl;
	else
		cout << sum2 << endl;

    return 0;
}

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

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

C++: #include "stdio.h"
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int a = 0;
	int b = 0;
	int aw,bw;
	for(int i = 0; i < 4; i++)
	{
		scanf("%d",&aw);
		a += aw;
	}
	for(int i = 0; i < 4; i++)
	{
		scanf("%d",&bw);
		b += bw;
	}
	printf("%d\n",max(a,b));
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>

void solve() {
    std::vector<int> sums(2, 0);
    for (auto& sum : sums) {
        for (int i = 0; i < 4; ++i) {
            int x;
            std::cin >> x;
            sum += x;
        }
    }

    std::cout << *std::max_element(sums.begin(), sums.end()) << "\n";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}