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 <string>
#include <algorithm>
#include <vector>
#include <stdlib.h>
#include <time.h>
#include <queue>
#include <sstream>
using namespace std;

int main(void){
	int sum[2];
	fill_n(sum, 2, 0);
	for(int i = 0; i < 2; i++){
		for(int j = 0; j < 4; j++){
			int a;
			cin >> a;
			sum[i] += a; 
		}
	}
	cout << max(sum[0], sum[1]) << endl;
}

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

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	int a=0,b=0;
	int i;
	for(i=0;i<4;i++){
		a+=in();
	}
	for(i=0;i<4;i++){
		b+=in();
	}
	cout<<max(a,b)<<endl;
}

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

int main(void)
{
        int a1, a2, a3, a4, a;
        int b1, b2, b3, b4, b;
        cin >> a1 >> a2 >> a3 >> a4;
        cin >> b1 >> b2 >> b3 >> b4;
        a = a1 + a2 + a3 + a4;
        b = b1 + b2 + b3 + b4;

        if(a <= b){
                cout << b << endl;
        }
        else if(a > b){
                cout << a << endl;
        }

        return (0);
}

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

int main(){
	int a,b,p;
	a = b = 0;
	
	for(int i = 0; i < 4; i++){
		cin >> p;
		a += p;
	}
	
	for(int i = 0; i < 4; i++){
		cin >> p;
		b += p;
	}
		
	if(a > b){
		cout << a;
	}else{
		cout << b;
	}
	
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
using namespace std;
int main(){
	
	int a,b;
	int 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;
	}
	
	cout<<max(s,t)<<endl;
	
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main( void )
{
	int a = 0;
	for ( int i = 0; i < 4; i++ )
	{
		int p;
		cin >> p;
		a += p;
	}

	int b = 0;
	for ( int i = 0; i < 4; i++ )
	{
		int p;
		cin >> p;
		b += p;
	}

	cout << max( a, b ) << endl;

	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,b,c,d;
	int 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++: #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
using namespace std;

int main(void) {

	int a = 0, b = 0, temp;

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

	printf("%d\n", max(a, b));

	return 0;
}

C++: #include <iostream>

int max(int a, int b) {
    if (a > b) 
        return a;
    else
        return b;
}

int main() {
    int a_inf, a_math, a_science, a_english;
    int b_inf, b_math, b_science, b_english;
    std::cin >> a_inf >> a_math >> a_science >> a_english;
    std::cin >> b_inf >> b_math >> b_science >> b_english;
    int S, T;
    S = a_inf + a_math + a_science + a_english;
    T = b_inf + b_math + b_science + b_english;
    std::cout << max(S, T) << std::endl;
    return 0;
}

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

int main()
{
	//??????
	int num1=0,num2=0,num3=0,num4=0,num5=0,num6=0,num7=0,num8=0,num9=0,num10=0;
	cin>>num1>>num2>>num3>>num4>>num5>>num6>>num7>>num8;
	num9=num1+num2+num3+num4;
	num10=num5+num6+num7+num8;
	if(num9>num10){
		cout<<num9;
		cout<<"\n";
		return 0;
	}
	if(num9<num10){
		cout<<num10;
		cout<<"\n";
		return 0;
	}
	if(num9==num10){
		cout<<num9;
		cout<<"\n";
		return 0;
	}
}

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

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

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

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

int main() {
	int a1, a2, a3, a4, b1, b2, b3, b4, total_a, total_b;
	cin >> a1 >> a2 >> a3 >> a4 >> b1 >> b2 >> b3 >> b4;

	total_a = a1 + a2 + a3 + a4;
	total_b = b1 + b2 + b3 + b4;

	cout << (total_a > total_b ? total_a : total_b) << endl;
	return 0;
}

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

int main(){
  int a=0,b=0;
  for(int i=0;i<4;i++){
    int c;
    cin>> c;
    a+=c;
  }

  for(int i=0;i<4;i++){
    int c;
    cin>> c;
    b+=c;
  }

  cout<< max(a,b)<< endl;
}

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

#include<vector>
#include<set>

using namespace std;

const int mod=1000000007;

int main()
{
	int sum1 = 0;
	for (int i = 0; i < 4; i++) {
		int buf = 0;
		cin >> buf;

		sum1 += buf;
	}

	int sum2 = 0;
	for (int i = 0; i < 4; i++) {
		int buf = 0;
		cin >> buf;

		sum2 += buf;
	}

	cout << max(sum1, sum2) << endl;

    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
 
using namespace std;
 
int main(){
    int a=0,b=0,in;
     
    for(int i=0;i<4;i++){
        scanf("%d",&in);
        a+=in;
    }
    for(int i=0;i<4;i++){
        scanf("%d",&in);
        b+=in;
    }
     
    if(a>b)
        printf("%d\n",a);
    else
        printf("%d\n",b);
     
    return 0;
}

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

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

int main()
{
  int a[4], b[4], s = 0, t = 0, i;

  REP(i, 4) cin >> a[i];
  REP(i, 4) cin >> b[i];
  REP(i, 4){
    s += a[i];
    t += b[i];
  }
  cout << max(s, t) << endl;
}