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

int main(){
	int info[2];
	int math[2];
	int science[2];
	int english[2];
	int S,T;
	cin>>info[0]>>math[0]>>science[0]>>english[0];
	cin>>info[1]>>math[1]>>science[1]>>english[1];
	S=info[0]+math[0]+science[0]+english[0];
	T=info[1]+math[1]+science[1]+english[1];
	if(S<T)cout<<T<<endl;
	else cout<<S<<endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int a, b, c, d, x, y, z, w, s, t;
	
	while(cin >> a >> b >> c >> d){
		s = a+b+c+d;
		cin >> a >> b >> c >> d;
		t = a+b+c+d;
		
		cout << ((s > t)? s : t) << endl;
	}
	
	return 0;
}

C++: #include <cstdio>

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

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
typedef struct{
    pii num,sc;
}hoge;
int main(){
    ll a,b,c,d; ll ans=-INF;
    rep(i,2){cin>>a>>b>>c>>d;ans=max(ans,a+b+c+d);}
    cout<<ans<<endl;
}

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

int in() {
	int res = 0;
	for(int i = 0; i < 4; ++i) {
		int in;
		cin >> in;
		res += in;
	}

	return res;
}

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

	cout << max(in(), in()) << endl;

	return EXIT_SUCCESS;
}

C++: #include <iostream>
using namespace std;
int n,s,t;
int main(){
	s=t=0;
	for(int i=0;i<4;i++){
		cin >> n;
		s+=n;
	}
	for(int i=0;i<4;i++){
		cin >> n;
		t+=n;
	}
	if(s>t){
		cout << s <<endl;
	}else{
		cout << t <<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];
	}
	else 
	{
	cout<<T[2];
	}
}

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 s=a+b+c+d;
    int t=e+f+g+h;
    if(s>t)
        cout<<s<<endl;
    else
        cout<<t<<endl;
    }

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

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
#define ll long long
#define PL pair<long long, long long>
#define P pair<int,int>
#define mk make_pair
#define en endl;
#define WHITE 0
#define BLACK 2
#define GRAY 1
#define RE return 0;

int main(){
  int suma=0,sumb=0;
  for(int i=0; i<4; i++){
    int a;
    cin>>a;
    suma+=a;
  }
  for(int i=0; i<4; i++){
    int b;
    cin>>b;
    sumb+=b;
  }
  
  cout<<(suma>=sumb ? suma:sumb)<<en
}

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

using namespace std;

int solve(int m){

	int A,B,ma,i,s,e;
	
	cin>>ma>>i>>s>>e;
		
		A=ma+i+s+e;
		
	cin>>ma>>i>>s>>e;
	
		B=ma+i+s+e;
		
	if(A>B){
		return A;
	}	
	else if(A<B){
		return B;
	}
	else {return A;
	}
	return m;
}

int main(){
	int n;
	cin >> n;
	cout << solve(n) << endl;
	return 0;
}

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 s1,s2,s3,s4,a;
	int t1,t2,t3,t4,b;

	cin >>s1;
	cin >>s2;
	cin >>s3;
	cin >>s4;
	a=s1+s2+s3+s4;
	cin >>t1;
	cin >>t2;
	cin >>t3;
	cin >>t4;
    b=t1+t2+t3+t4;
    if(a>b)cout << a << endl;
    else cout << b << endl;


	return 0;
}

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

using namespace std;

int main()
{
    int n;
    int a, b;
    int i;

    a = b = 0;
    for (i = 0; i < 8; i++){
        scanf("%d", &n);

        if (i < 4){
            a += n;
        }
        else {
            b += n;
        }
    }
    printf("%d\n", max(a, b));

    return (0);
}

C++: #include <iostream>
using namespace std;
int kobuta;
int tanuki;
int kitune;
int neko;
int koara;
int rakko;
int komodoootokage;
int gengorou;
int usi;
int main(){
  cin>>kobuta>>tanuki>>kitune>>neko;
  cin>>koara>>rakko>>komodoootokage>>gengorou;
  if(kobuta+tanuki+kitune+neko>koara+rakko+komodoootokage+gengorou){
    cout<<kobuta+tanuki+kitune+neko;}
  else{
    cout<<koara+rakko+komodoootokage+gengorou;}
  return 0;
}