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 <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
  if (n & 1) res = res * x % mod;
  return res;
}

int main() {
    ll res1 = 0, res2 = 0;
    ll a;
    rep(i, 4) {
        cin >> a;
        res1 += a;
    }
    rep(i, 4) {
        cin >> a;
        res2 += a;
    }
    cout << max(res1, res2) << endl;
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define EPS 1e-10
using namespace std;
typedef long long llong;
int main() {
	int a = 0, b = 0;
	int x;
	for (int i = 0; i < 4; i++) {
		cin >> x;
		a += x;
	}
	for (int i = 0; i < 4; i++) {
		cin >> x;
		b += x;
	}
	cout << max(a, b) << endl;
	return 0;
}

C++: // Example program
#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;

int main()
{
    int a; int b; int c; int d; int e; int f; int g; int h;
    cin>>a>>b>>c>>d>>e>>f;
   vector<int>v{a+b+c+d,e+f+g+h};
   sort(v.begin(),v.end());
   cout << v[1] << endl;
}

C++: #include <cstdio>
#define max(a,b) ((a)>=(b)?(a):(b))
int main() {
	int s=0,t=0,p;
	for(int i=0;i<4;i++)
		scanf("%d",&p),s+=p;
	for(int i=0;i<4;i++)
		scanf("%d",&p),t+=p;
	printf("%d\n",max(s,t));
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,e,f,x;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&f);
	if(a<=40){
		a=40;
	}
	if(b<=40){
		b=40;
	}
	if(c<=40){
		c=40;
	}
	if(d<=40){
		d=40;
	}
	if(f<=40){
		f=40;
	}
	x=(a+b+c+d+f)/5;
	printf("%d\n",x);
	return 0;
}

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

int main(){
	int a[4];
	int b[4];
	cin>>a[0]>>a[1]>>a[2]>>a[3];
	cin>>b[0]>>b[1]>>b[2]>>b[3];
	int S;
	int T;
	S = a[0]+a[1]+a[2]+a[3];
	T = b[0]+b[1]+b[2]+b[3];
	if(S>=T){
		cout<<S<<endl;
	}
	else{
		cout<<T<<endl;
	}	
	return 0;
}

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

int main(){
  int a[4],b[4];
  int n=0;
  while(cin>>a[n]){
    n++;
    if(n==4)break;
  }

  n=0;

  while(cin>>b[n]){
      n++;
if(n==4)break;
    }
 int  A=a[0]+a[1]+a[2]+a[3];
 int  B=b[0]+b[1]+b[2]+b[3];
  if(A>B){
    cout << A << endl;
  }
  if(A<B){
    cout << B << endl;
  }
  if(A=B){
    cout << A << endl;
  } 

    return 0;
}

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

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

int main(){

	int p, pt1, pt2;
	
	pt1 = 0;
	pt2 = 0;
	
	for(int i=0; i<2; i++){
		for(int j=0; j<4; j++){
			cin >> p;
			if(i == 0) pt1 += p;
			else pt2 += p;
		}
	}
	
	if(pt1 > pt2) cout << pt1 << endl;
	else if(pt1 < pt2) cout << pt2 << endl;
	else cout << pt1 << endl;

	return 0;

}

C++: #include<stdio.h>
int main(void)
{
	int a1,a2,a3,a4,b1,b2,b3,b4,s,s1;
	scanf("%d %d %d %d",&a1,&a2,&a3,&a4);
	scanf("%d %d %d %d",&b1,&b2,&b3,&b4);
	s=a1+a2+a3+a4;
	s1=b1+b2+b3+b4;
	if(s>=s1){
		printf("%d\n",s);
	}
	else if(s<s1){
		printf("%d\n",s1);
	}

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,sumA=0;
    int x,y,z,u,sumB=0;
    cin >> a >> b >> c >> d;
    cin >> x >> y >> z >> u;
    
    sumA=a+b+c+d;
    sumB=x+y+z+u;
    
    if(sumA==sumB)
        cout << sumA << endl;
    else if(sumA>sumB)
        cout << sumA << endl;
    else
        cout << sumB << endl;
    
    
}

C++: #include <stdio.h>
int main(void){
    int total_a=0, total_b=0, a, b;
    for(int i=1; i<=4; i++){
        scanf("%d", &a);
        total_a += a;
    }
    for(int i=1; i<=4; i++){
        scanf("%d", &b);
        total_b += b;
    }
    if(total_a >= total_b) printf("%d\n", total_a);
    else printf("%d\n", total_b);
    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 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<stdio.h>
#include<iostream>
#include<string>
#include<math.h>

using namespace std;

int main(){
	int tmp;
	int asum = 0;
	int bsum = 0;


	for (int i = 0; i < 4; i++) {
		cin >> tmp;
		asum += tmp;
	}
	for (int i = 0; i < 4; i++) {
		cin >> tmp;
		bsum += tmp;
	}

	if (asum > bsum) {
		cout << asum;
	}
	else cout << bsum;

	cout << endl;



	//system("pause");
    return 0;
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
int main()
{
	int i,j,n,s=0,t=0;
	for(i=1;i<=4;i++)
	{
		cin>>n;
		s+=n;
	}
	for(i=1;i<=4;i++)
	{
		cin>>n;
		t+=n;
	}
	if(s>=t)cout<<s<<endl;
	else cout<<t<<endl;
}

C++: #include <stdio.h>

int main(void) {
    int a1, a2, a3, a4, b1, b2, b3, b4, S, T;

    scanf ("%d %d %d %d\n", &a1, &a2, &a3, &a4);    
    scanf ("%d %d %d %d\n", &b1, &b2, &b3, &b4);

    S = a1 + a2 + a3 + a4;
    T = b1 + b2 + b3 + b4;

    if (S > T) {
        printf ("%d\n", S);
    }
    else {
        printf ("%d\n", T);
    }

    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
typedef long long int ll;
using namespace std;

int main(){
	int a,b,c,d,e,f,g,h;
	cin >>a>>b>>c>>d>>e>>f>>g>>h;
	cout <<max(a+b+c+d,e+f+g+h) << endl;
}