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

int main() {
	int A=0, B=0, tmp;
	for (int i=0; i<4; i++) {
		cin >> tmp;
		A += tmp;
	}
	for (int i=0; i<4; i++) {
		cin >> tmp;
		B += tmp;
	}
	int ans = max(A, B);
	cout << ans << endl;
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int a, b, c, d;
	while(cin >> a >> b >> c >> d)
	{
		int e, f, g, h;
		cin >> e >> f >> g >> h;
		int sum1 = a + b + c + d;
		int sum2 = e + f + g + h;
		if(sum1 >= sum2)
		{
			cout << sum1 << endl;
		}
		else
		{
			cout << sum2 << endl;
		}
	}
}

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

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

using namespace std;

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

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

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

int main() {
	// your code goes here
	int A=0,B=0;
	for(int i=0;i<4;i++){
		int temp;
		cin >> temp;
		A+=temp;
	}
	for(int i=0;i<4;i++){
		int temp;
		cin >> temp;
		B+=temp;
	}
	if(A<B)
		cout << B << endl;
	else
		cout << A << endl;
	return 0;
}

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

int main() {

  long long int s[2] = {0};

  for ( long long int x = 0; x < 2; x++ ) {
    for ( long long int i = 0; i < 4; i++ ) {
      long long int in;
      cin >> in;
      s[x] += in;
    }
  }

  if ( s[0] > s[1] ) {
    cout << s[0] << endl;
  }else {
    cout << s[1] << endl;
  }

  return 0;

}

C++: #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef long long ll;

int main()
{
  int a = 0, b = 0;
  FOR(i,0,4) {
    int in;
    cin >> in;
    a += in;
  }
  FOR(i,0,4) {
    int in;
    cin >> in;
    b += in;
  }
  cout << (a > b ? a : b) << endl;
  return 0;
}

C++: #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

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

	for (int i = 0; i < 2; i++) {
		cin >> H >> W >> L >> R;
		N = max(N, H + W + L + R);
	}
	cout << N << endl;
	
	return 0;
}

C++: // Tazoe

#include <iostream>
using namespace std;

int main()
{
	int A1, A2, A3, A4;
	cin >> A1 >> A2 >> A3 >> A4;

	int B1, B2, B3, B4;
	cin >> B1 >> B2 >> B3 >> B4;

	int S = A1+A2+A3+A4;
	int T = B1+B2+B3+B4;

	if(S>=T){
		cout << S << '\n';
	}
	else{
		cout << T << '\n';
	}

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int Ai,Am,As,Ae,Bi,Bm,Bs,Be;
    cin>>Ai>>Am>>As>>Ae>>Bi>>Bm>>Bs>>Be;
    cout<<(Ai+Am+As+Ae>Bi+Bm+Bs+Be?Ai+Am+As+Ae:Bi+Bm+Bs+Be)<<endl;
}

C++: #include <iostream>
using namespace std;
int main() 
{
	int a, b, c, d, e, f, g, h, A, B;
	cin >> a >> b >> c >> d;
	cin >> e >> f >> g >> h;
	A = a + b + c + d;
	B = e + f + g + h;
	if (A >= B) {
		cout << A << endl;
	}
	else
		cout << B << endl;
	return 0;
}

C++: #include "bits/stdc++.h"
#define rep(i,a,n) for(int i = (a);i < (n);i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

int main(){
    
    int a,b,sumA = 0,sumB = 0;
    
    rep(i,0,4){
        cin >> a;
        sumA += a;
    }
    
    rep(i,0,4){
        cin >> b;
        sumB += b;
    }
    
    cout << max(sumA,sumB) << endl;
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a, b, c, d; 
    int s, t, u, v;
    cin >> a >> b >> c >> d;
    cin >> s >> t >> u >> v;
    int sum = a + b + c + d;
    int summ = s + t + u + v;
    if (sum < summ)
    cout << summ << endl;
    else
    cout << sum << endl;
    
    
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int sum1=0,sum2=0;
  int m;
  for(int i=0;i<4;i++){
    cin >> m;
    sum1+=m;
  }
  for(int i=0;i<4;i++){
    cin >> m;
    sum2+=m;
  }
  if(sum1>=sum2){
    cout << sum1 << endl;
  } else{
    cout << sum2 << endl;
  }
  return(0);
}

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

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

C++: #include <iostream>

using namespace std;

int main()
{
	int in[4];
	int total[2];

	for(int i = 0; i < 2; i++){
		total[i] = 0;
		for(int j = 0; j < 4; j++){
			cin >> in[j];
			total[i] += in[j];
		}
	}

	if(total[0] > total[1]){
		cout << total[0] << endl;
	}
	else{
		cout << total[1] << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std; 
int main(){
  int a,b,c,d;
  int w,x,y,z;
  cin>>a>>b>>c>>d;
  cin>>w>>x>>y>>z;
  int A=a+b+c+d;
  int B=w+x+y+z;
  if(A>B) cout<<a<<endl;
  if(A<B) cout<<B<<endl;
  if(A==B) cout<<A<<endl;
  


  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std ;
int main()
{
    int score[2] = {0} ;
    int cmp = 0 ;

    for (int i = 0 ; i < 2 ; i++ )
    {
        for ( int j = 0 ; j < 4 ; j++ )
        {
            cin >> cmp ;
            score[i] += cmp ;
        }
    }

    if ( score[0] >= score[1] )
    {
        cout << score[0] << endl ;
    } else cout << score[1] << endl ;

    return 0 ;
}

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

int main() {
	vector<int> a(4), b(4);
	for (int& i : a) cin >> i;
	for (int& i : b) cin >> i;
	cout << max(accumulate(a.begin(), a.end(), 0), accumulate(b.begin(), b.end(), 0)) << endl;
}

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<iostream>

using namespace std;

int main(){
	int S = 0, T = 0, s[4], t[4];

	for(int i = 0; i < 4; i++){
		cin >> s[i];
		S += s[i];
	}
	for(int i = 0; i < 4; i++){
		cin >> t[i];
		T += t[i];
	}

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

	return 0;
}

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