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>
using namespace std;

int main(int argc, char *argv[]){
  int suma = 0, sumb = 0;
  int tmp;
  for (int i = 0; i < 4; i++) {
    cin >> tmp;
    suma += tmp;
  }
  for (int i = 0; i < 4; i++) {
    cin >> tmp;
    sumb += tmp;
  }

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

  return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<queue>
#include<stack>
#define MAX_N 100000000

using namespace std;

    struct A{
        int score[5];
        int ans=0;
    } A;
    
    struct B{
        int score[5];
        int ans=0;
    } B;
int main(){

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

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

    A.ans>=B.ans ? cout<<A.ans<<endl : cout<<B.ans<<endl;

    return 0;
}

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

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<<endl;
	else
		cout<<t<<endl;
	return 0;
}

C++: #include <iostream>
int main(){int a,b,c,d,e,f,g,h;std::cin>>a>>b>>c>>d>>e>>f>>g>>h;a+=b+c+d;e+=f+g+h;std::cout<<(a>e?a:e)<<"\n";}

C++: #include<iostream>
using namespace std;
int main(){
	int sa[3], sb[3];
	cin >> sa[0] >> sa[1] >> sa[2] >> sa[3];
	cin >> sb[0] >> sb[1] >> sb[2] >> sb[3];
	if ((sa[0] + sa[1] + sa[2] + sa[3]) > (sb[0] + sb[1] + sb[2] + sb[3]){
		cout << sa[0] + sa[1] + sa[2] + sa[3] << endl;
	}
	else{
		cout << sb[0] + sb[1] + sb[2] + sb[3] << endl;
	}
return 0;
}

C++: #include<bits/stdc++.h>

using namespace std;

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

C++: #include<iostream>
using namespace std;
int main(){
  int J,S,R,E,P1,P2;
  cin >> J >> S >> R >> E;
  P1=J+S+R+E;
  cin >> J >> S >> R >> E;
  P2=J+S+R+E;
  if(P1<P2){
    cout << P2 << endl;
  }
  else if(P2<P1){
    cout << P1 << endl;
  }
  else if(P1==P2){
    cout << P1 << endl;
  }
  return (0);
}

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

int a, s, t;

int main() {
	rep(i,4) scanf("%d",&a), s += a;
	rep(i,4) scanf("%d",&a), t += a;
	printf("%d\n",max(s,t));
}

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

using namespace std;

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

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

    cout << max( accumulate( a, a+4, 0 ), accumulate( b, b+4, 0 ) ) << endl;
}

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

C++: #include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <queue>

using namespace std;
int main(){
	int ab[10]={0};
	int ta=0,tb=0;
	

	for(int i=0;i<8;i++){
		cin >> ab[i];
	}

	for(int i=0;i<8;i++){
		if(3<i){
			tb+=ab[i];
		}
		
		else ta+=ab[i];
	}

	if(ta>tb){
		cout << ta << endl;
	}
	else cout << tb << endl;
	return 0;
}

C++: #include<iostream>
#using namespase 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++: #include<bits/stdc++.h>
using namespace std;

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

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

int main(){
	int a, s[2]={0};
		
	for(int i=0; i<2; ++i){
		for(int j=0; j<4; ++j){
			scanf(" %d", &a);
			s[i]+=a;
		}
	}
	
	if(s[0]>=s[1]) printf("%d\n", s[0]);
	else printf("%d\n", s[1]);

	return 0;
}

C++: #include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <random>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
#include <chrono>
#include <cstdlib>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
const double pi = acos(-1);
typedef pair<int, int> P;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EPS 1e-4
#define OUTPUT(i) (cout << (ll)i << endl)
#define ALL(a) ((a).begin(), (a).end())

bool operator<(const pair<ll, ll> &a, const pair<ll, ll> &b)
{

    if (a.first == b.first)
        return a.second < b.second;

    return a.first < b.first;
}

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
int N, K;
int ub, lb;
int ans[1008];
vector<vector<int>> v(1001);

bool check()
{

    for (int i = 0; i < K; ++i)
    {
        int cnt = 0;
        for (int j = 0; j < N / 2; ++j)
        {
            cnt += ans[v[i][j]];
        }
        if (cnt < lb || cnt > ub)
            return false;
    }
    return true;
}

void solve()
{
    for (int i = 0; i < N / 2; ++i)
        ans[i] = 1;
    while (1)
    {
        std::random_device seed_gen;
        std::mt19937 engine(seed_gen());
        shuffle(ans, ans + N, engine);
        if (check())
            break;
    }
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    //cout << fixed << setprecision(15);

    int arr[8];
    for (int i = 0; i < 8; ++i)
        cin >> arr[i];

    cout << max(arr[0] + arr[1] + arr[2] + arr[3], arr[4] + arr[5] + arr[6] + arr[7]) << endl;
    
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int a[2][4];
  for(int i=0;i<2;i++)
    for(int j=0;j<4;j++)
      cin>>a[i][j];
  int s[2]={};
  
  for(int i=0;i<2;i++)
    for(int j=0;j<4;j++)
      s[i]+=a[i][j];
  
  cout<<max(s[0],s[1])<<endl;
  return 0;
}

C++: #include <iostream>

using namespace std;

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

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

	if (s >= t){
		cout << s << endl;
	}
	else {
		cout << t << endl;
	}
		
}

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

using namespace std;

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

	return 0;
}