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 aj,am,as,ae;
 int bj,bm,bs,be;
 int s=0,t=0;

 cin >> aj >> am >> as >> ae;
 cin >> bj >> bm >> bs >> be;

 s = aj+am+as+ae;
 t = bj+bm+bs+be;

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

return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a1,a2,a3,a4,b=0;
	for(int i=0;i<2;i++){
		cin >> a1 >> a2 >> a3 >> a4;
		if(a1+a2+a3+a4>=b)b=a1+a2+a3+a4;
	}
	cout << b <<endl;
	return 0;
}

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<iostream>
using namespace std;
int main()
{
int a1,b1,c1,d1,a2,b2,c2,d2,T1,T2,T;
cin >> a1 >> b1 >> c1 >> d1;
cin >> a2 >> b2 >> c2 >> d2;
if(a1>100){
        cout << "エラー" << endl;
        return 0;
}
if(b1>100){
        cout << "エラー" << endl;
        return 0;
}
if(c1>100){
        cout << "エラー" << endl;
        return 0;
}
if(d1>100){
        cout << "エラー" << endl;
        return 0;
}
if(a2>100){
        cout << "エラー" << endl;
        return 0;
}
if(b2>100){
        cout << "エラー" << endl;
        return 0;
}
if(c2>100){
        cout << "エラー" << endl;
        return 0;
}
if(d2>100){
        cout << "エラー" << endl;
        return 0;
}

T1=a1+b1+c1+d1;
//cout << T1 << endl;
T2=a2+b2+c2+d2;
//cout << T2 << endl;
if(T1>T2){
        T=T1;
	//cout << "T1" << endl;
}
if(T2>T1){
        T=T2;
	//cout << "T2" << endl;
}
if(T1==T2){
        T=T1=T2;
	//cout << "T1=T2" << endl;
}
cout << T << endl;
return 0;
}

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

int main(){

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

    cout << max(x, y) << endl;
    return 0;
}

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

typedef long long ll;
using namespace std;

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

	int a[2] = {0,0};

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

	cout << max(a[0],a[1]) << endl;

	return 0;

}

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

int main(){
	int inf, mat, sci, eng;
	int S, T;
	
	scanf("%d%d%d%d", &inf, &mat, &sci, &eng);
	S = inf + mat + sci + eng;
	scanf("%d%d%d%d", &inf, &mat, &sci, &eng);
	T = inf + mat + sci + eng;
	
	printf("%d\n", max(S, T));
	
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,s,s1,i;
	for(i=0;i<4;i++){
		scanf("%d",&a);
		s+=a;
	}
	for(i=0;i<4;i++){
		scanf("%d",&b);
		s1+=b;
	}
	if(s>s1){
		printf("%d\n",s);
	}
	else if(s<s1){
		printf("%d\n",s1);
	}
	else{
		printf("%d\n",s);
	}
	return 0;
}

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

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

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

using namespace std;

int main(){
  int i,j,sum,sumb,n;
  sum=0;
  sumb=0;

  for(i=0;i<4;i++){cin >> n;
  sum+=n;
  }

  for(i=0;i<4;i++){cin >> n;
    sumb+=n;}

  int xmax=0;  
  xmax=max(sum,sumb);

  cout << xmax << endl;




}

C++: //============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
int A[4],B[4];
int main() {
	int S=0,T=0;
	for(int i=0;i<4;i++){
		cin>>A[i];
		S+=A[i];
	}
	for(int j=0;j<4;j++){
		cin>>B[j];
		T+=B[j];
	}
	if(S<T)cout<<T<<endl;
	if(S>T || S==T)cout<<S<<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;
	cin >> 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 <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <fstream>
using namespace std;
typedef long long ll;

int main()
{
	int A = 0, B = 0, a, b;
	for(int i = 0; i < 4; i++){
		cin>>a;
		A += a;
	}
	for(int i = 0; i < 4; i++){
		cin>>b;
		B += b;
	}
	cout<<max(A, B)<<endl;
	//cin.sync(); cin.get();
}

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

int point,a,b;

int main (){
  a=0;
  b=0;
  for(int i=0;i<4;i++){
    scanf("%d",&point);
    a = a + point;
  }

  for(int i=0;i<4;i++){
    scanf("%d",&point);  
    b = b + point;
  }

  if(a>b){
    printf("%d",a);
  }
  else{
    printf("%d",b);
  }
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int a, b, c, d, e, f, g, h;

int main(){
  while(~scanf("%d%d%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f, &g, &h))
    printf("%d\n", max(a+b+c+d, e+f+g+h));
  return 0;
}

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

using namespace std;

int main() {

	int S = 0, T = 0;

	for (int i = 0; i < 4; ++i) {
		int temp;
		cin >> temp;
		S += temp;
	}
	for (int i = 0; i < 4; ++i) {
		int temp;
		cin >> temp;
		T += temp;
	}

	cout << max(S, T) << endl;

	return 0;
}

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

int main(){
  int Ainfo,Amath,Ascience,Aenglish,Binfo,Bmath,Bscience,Benglish;
  cin >> Ainfo >> Amath >> Ascience >> Aenglish;
  cin >> Binfo >> Bmath >> Bscience >> Benglish;
  int totalA=0,totalB=0;
  totalA = Ainfo + Amath + Ascience + Aenglish;
  totalB = Binfo + Bmath + Bscience + Benglish;

  if(totalA < totalB){
    cout << totalB << endl;
  }else if(totalB < totalA){
    cout << totalA << endl;
  }else if(totalA == totalB){
    cout << totalA << endl;
  }
  
  return 0;
}

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