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<map>
#include<vector>
#include<list>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<climits>
#include<ctime>
#include<cstring>
#define REP(i,p,n) for(int i=p;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()

using namespace std;
template<class T> inline void chmax(T& a, T b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, T b) { if(b < a) a = b; }

int main() {
	int S,T;
	int a,b,c,d;	
	cin >> a >> b >> c >> d;
	S = a + b + c + d;
	cin >> a >> b >> c >> d;
	T = a + b + c + d;

	if (S > T) {
		cout << S << endl;
	}
	else {
		cout << T << endl;
	}

	return 0;
}

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

int main() {
    int sum1 = 0, sum2 = 0;
    for(int i=0; i<4; ++i) {
        int a; cin >> a;
        sum1 += a;
    }
    for(int i=0; i<4; ++i) {
        int a; cin >> a;
        sum2 += a;
    }
    cout << max(sum1, sum2) << endl;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <memory>
#include <memory.h>
#include <fstream>
#include <cmath>
#include <math.h>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <map>
#include <iomanip>
#include <list>
#include <cctype>
#include <algorithm>
#include <complex>

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)
using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<double, double> Pd;
typedef pair<int, P> PP;
typedef pair<int, PP> PPP;
const int INF = 1 << 29;
const double EPS = 1E-10;

#define rep(i, n) for(int i = 0; i < n; i++)

int main(){
	int a,b, num;
	a = 0, b = 0;
	while(cin >> num && num){
		a += num;
		rep(i, 3){
			cin >> num;
			a += num;
		}
		rep(i, 4) {
			cin >> num;
			b += num;
		}
		cout << max(a, b) << endl;
		a = 0, b = 0;
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <fstream>
#include <algorithm>
#include <math.h>
#include <map>
using namespace std;

#define rep(i, n) for (int i = 0; i < n; i++)

bool has_key_using_count(map<char, char> &m, char n){
    if (m.count(n) == 0){
        return false;
    }
    else{
        return true;
    }
}

int main()
{
	//ifstream cin("sample.txt");

	int n = 0, sumA = 0, sumB = 0, t = 0, ans = 0;
	
	

	return 0;
}

C++: #include <iostream>
 
using namespace std;
 
int main() {
  int A_score;
  int S = 0;
  for (int i = 0; i < 4; i++) {
    cin >> A_score;
    S += A_score;
  }
  int B_score;
  int T = 0;
  for (int i = 0; i < 4; i++) {
    cin >> B_score;
    T += B_score;
  }
  S >= T ? cout << S << endl : cout << T << endl;
  return 0;
}

C++: // JOI - Prelim  0510
// 得点
#include <bits/stdc++.h>

using namespace std;

template <typename T>
using vec1 = vector<T>;

template <typename T>
T cin2var()
{
    T val;
    cin >> val;
    return val;
}

template <typename T>
vec1<T> cin2vec(size_t size)
{
    vec1<T> vec1(size);
    for (auto& v : vec1) {
        v = cin2var<T>();
    }
    return vec1;
}

void sub()
{
    const auto As(cin2vec<int64_t>(4));
    const auto Bs(cin2vec<int64_t>(4));

    const int64_t sumA = accumulate(As.cbegin(), As.cend(), 0ll);
    const int64_t sumB = accumulate(Bs.cbegin(), Bs.cend(), 0ll);

    const int64_t ans = max(sumA, sumB);
    cout << ans << endl;
}

int main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    sub();
    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;
    cin>>a>>b>>c>>d>>e>>f;
   vector<int>v{a+b+c,d+e+f};
   sort(v.begin(),v.end());
   cout << v[1] << endl;
}

C++: #include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <algorithm>

#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,a,b) for(int i=a; i<=b; i++)
#define ll long long int

using namespace std;

int main(void) {
    int s=0 , t=0;
    REP(i,4){
        int a;
        cin >> a;
        s+=a;
    }
    REP(i,4){
        int a;
        cin >> a;
        t+=a;
    }
    cout << max(s,t) << endl;
    
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<map>
#include<algorithm>

using namespace std;

int main(){
	int score1[4],score2[4];
	int total1,total2;
	total1=total2=0;
	for(int i=0;i<4;i++){
		cin>>score1[i];
		total1 += score1[i];
 	}
	for(int i=0;i<4;i++){
		cin>>score2[i];
		total2 += score2[i];
	}
	if(total1>total2)cout<<total1<<endl;
	else cout<<total2<<endl;
	return 0;
}

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

using namespace std;

int main() {
	int A=0, B=0, t;

	for (int i = 0; i < 4; i++) {
		scanf("%d", &t);
		A += t;
	}
	for (int i = 0; i < 4; i++) {
		scanf("%d", &t);
		B += t;
	}

	printf("%d", max(A, B));

	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int a, b, c, d, s, t;

	cin >> a >> b >> c >> d;

	s = a + b + c + d;

	cin >> a >> b >> c >> d;

	t = a + b + c + d;

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

	return 0;
}

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<cstdio>
#include<iostream>
using namespace std;
int main()
{
	int i,j,n,s=0,t=0;
	for(i=1;i<=4;i++)
	{
		cin>>n;
		s+=n;
	}
	for(i=1;i<=4;i++)
	{
		cin>>n;
		t+=n;
	}
	if(s>=t)cout<<s;
	else cout<<t;
}

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

int main(){
	int sum1 = 0, sum2 = 0, a1, a2;	
	for(int i = 0; i < 4; i++){
		cin >> a1;
		sum1 += a1;
	}
	for(int i = 0; i < 4; i++){
		cin >> a2;
		sum2 += a2;
	}

	if(a1 >= a2){
		cout << sum1 << endl;
	}else{
		cout << sum2 << endl;
	}

}