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 a[4][4];
  for(int b=0;b<4;b++){
    cin >> a[0][b];
  }
  for(int c=0;c<4;c++){
    cin >> a[1][c];
  }

  if((a[0][0]+a[0][1]+a[0][2]+a[0][3]) > (a[1][0]+a[1][1]+a[1][2]+a[1][3])){
    cout << a[0][0]+a[0][1]+a[0][2]+a[0][3] << endl;
  }
  else{
    cout << a[1][0]+a[1][1]+a[1][2]+a[1][3] << endl;
  }

  return 0;
}

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

int main(){
	int i,m,s,e,a,b,aa;
	
	for(aa=0;aa<2;aa++){
		cin >> i >> m >> s >> e;
		
		if(aa==0){
			a = i + m + s + e;
		}
		if(aa==1){
			b = i + m + s + e;
		}
	}
	
	if(a>b || a==b){
		cout << a << endl;
	}
	
	else if(a<b){
		cout << b << endl;
	}
	
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a=0,b=0,s=0,t=0;
	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){
		cout << t << endl;
	}
	else{
		cout << s << endl;
	}
	
	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {

	int s[5], t[5], ss ,st;

	while(1) {
		ss=st=0;
		for(int i=0; i<4; i++) {
			cin >> s[i];
		}
		for(int i=0; i<4; i++) {
			cin >> t[i];
		}
		for(int i=0; i<4; i++) {
			ss+=s[i];
			st+=t[i];
		}
		if(ss>=st)
			cout << ss << endl;
		else
			cout << st << endl;
	}

	return 0;

}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
    int a = 0;
    for (int i = 0; i < 4; ++i) {
        int s;
        cin >> s;
        a += s;
    }
    int b = 0;
    for (int i = 0; i < 4; ++i) {
        int s;
        cin >> s;
        b += s;
    }
    cout << max(a, b) << '\n';
}

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

int main()
{
  int a,b,c,d;
  int n = 2;
  int Max = 0;
  while(n--){
  scanf("%d %d %d %d",&a,&b,&c,&d);
  getchar();
   Max =max(Max,a+b+c+d);
  }
  cout <<Max<<endl;
  return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#include<cstring>
#include<set>
#include<map>
#include<vector>
#include<cmath>
#include<queue>
#include<cstdio>
#include<cstdlib>
#define reep(n1,n2,n3) for(int n1=n3;n1<n2;n1++)
#define rep(n1,n2) reep(n1,n2,0)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define INF 1e9
using namespace std;
typedef long long int lint;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<pair<int,int> > vp;
typedef pair<int,int> pi;
typedef pair<int,pair<int,int> > pii;
typedef vector<string> vs;
const double PI  = acos(-1.0);
int main(){
    int s,t;
    rep(i,4){
        int a;
        cin>>a;
        s+=a;
    }
    rep(i,4){
        int a;
        cin>>a;
        t+=a;
    }
    cout<<(s>=t?s:t)<<endl;
}

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

using namespace std;

int main() {
	int a, s, d, f, g, h, j, k;
	cin >> a, s, d, f, g, h, j, k;
	if (a + s + d + f > g + h + j + k) {
		cout << a + s + d + f << endl;
	}
	else {
		cout << g + h + j + k << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
	int a[2] = { 0 };
	for (int i = 0; i < 2; i++) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		a[i] += a + b + c + d;
	}
	cout << max(a[0], a[1]) << endl;
}

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;
	}

}

C++: #include <iostream>
using namespace std;
int main(void){
    int Aj,As,Ar,Ae;
    int Bj,Bs,Br,Be;
    int S,T;
    cin >> Aj >> As >> Ar >> Ae;
    cin >> Bj >> Bs >> Br >> Be;
    S=Aj+As+Ar+Ae;
    T=Bj+Bs+Br+Be;
    if(S>T)     cout << S << endl;
    else if(T>S)cout << T << endl;
    else        cout << S << endl;
}

C++: #include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	double n, a, b, c, d, ans = 0;
	for (int i = 0; i < 2; i++) {
		cin >> a >> b >> c >> d;
		ans = max(ans, a + b + c + d);
	}
	cout << ans << endl;
	cin >> n;
}

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

using namespace std;

int main()
{
    int a1, a2, a3, a4;
    int b1, b2, b3, b4;
    
    cin >> a1 >> a2 >> a3 >> a4;
    cin >> b1 >> b2 >> b3 >> b4;
    
    cout << max(a1+a2+a3+a4,b1+b2+b3+b4) << endl;
}

C++: #include<iostream>
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];
  int i,j;
  if((i=a[0]+a[1]+a[2]+a[3]) >= (j=b[0]+b[1]+b[2]+b[3])) {
    std::cout<<i;
  }else{
    std::cout<<j;
  }
}

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

C++: #include <bits/stdc++.h>
using namespace std;
static const int INF = 2000000000;
static const int NIL = -1;
typedef long long ll;

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

C++: #include<stdio.h>
#include<math.h>
int a,b,c;main(){for(;scanf("%d",&a);b+=a);for(;scanf("%d",&a);c+=a);printf("%d",max(b,c));}

C++: #include <iostream>
#include <cassert>
#define REP(i,l,n) for(int i=l;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define MAX 10000
int sumA=0,sumB=0;
int a[4],b[4];
using namespace std;
int main() {
  rep(i,4) cin >> a[i];
  rep(i,4) cin >> b[i];
  rep(i,4) sumA += a[i];
  rep(i,4) sumB += b[i];
  if(sumB>sumA){
    cout << sumB << endl;
  }else{
    cout << sumA << endl;
  }
  return 0;
}

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

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int a = 0, b = 0;
    for (int i = 0; i < 4; ++i) {
        int k;
        cin >> k;
        a += k;
    }
    for (int j = 0; j < 4; ++j) {
        int k;
        cin >> k;
        b += k;
    }
    cout << max(a, b) << "\n";
    return 0;
}

C++: #include <cstdio>

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

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

int main(){
  int a[4];
  int t[4];
  int a_ans = 0;
  int t_ans = 0;
  int ans = 0;

  for(int i = 0; i < 4; i++){
    cin >> a[i];
    a_ans+=a[i];
  }

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

  ans = max(t_ans,a_ans);
  cout << ans << endl;

}