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(void){
    // Your code here!
    int S=0,A[4]={0};
  int T=0,B[4]={0};
  for(int i=0;i<4;i++){
      cin >> A[i];
      S+=A[i];
  }
  for(int i=0;i<4;i++){
      cin >> B[i];
      T+=B[i];
  }
  if(S>T){
      cout << S << endl;
  }else if(S<T){
      cout << T << endl;
  }else if(S==T){
      cout << S << endl;
  }
}

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

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

        int a,b,c,d;
        int a_sum, b_sum;

        cin >> a >> b >> c >> d;
        a_sum = a + b + c + d;
        cin >> a >> b >> c >> d;
        b_sum = a + b + c + d;

        if(a_sum == b_sum)      cout << a_sum << "\n";
        else                    cout << ((a_sum > b_sum) ? a_sum : b_sum)  << "\n";

        return 0;
}

C++: //include
//------------------------------------------
#include <bits/stdc++.h> // only for GCC

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

//repetition
//------------------------------------------
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

// output vector
// ------------------------------------------
namespace std {
    template<typename T>ostream&operator<<(ostream&os, vector<T>const&v){
        iter(it,v) os<<*it<<(it+1==v.end()?"":",");
        return os;
    }
    template<typename T, typename U>ostream&operator<<(ostream&os,const pair<T,U>&p){
        return os << "[" << p.dirst << "," << p.second << "]";
    }
}

//clear memory
// ------------------------------------------
#define clr(a,i) memset((a), (i) ,sizeof(a))

int main(){
   vi a(4),b(4);
   rep(i,4)cin>>a[i];
   rep(i,4)cin>>b[i];
   if(accumulate(all(a),0)>accumulate(all(b),0)) cout << accumulate(all(a),0) endl;
   else cout << accumulate(all(a),0) endl;
}

C++: //include
//------------------------------------------
#include <bits/stdc++.h> // only for GCC

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

//repetition
//------------------------------------------
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

// output vector
// ------------------------------------------
namespace std {
    template<typename T>ostream&operator<<(ostream&os, vector<T>const&v){
        iter(it,v) os<<*it<<(it+1==v.end()?"":",");
        return os;
    }
    template<typename T, typename U>ostream&operator<<(ostream&os,const pair<T,U>&p){
        return os << "[" << p.dirst << "," << p.second << "]";
    }
}

//clear memory
// ------------------------------------------
#define clr(a,i) memset((a), (i) ,sizeof(a))

int main(){
   vi a(4),b(4);
   rep(i,4)cin>>a[i];
   rep(i,4)cin>>b[i];
   if(accumulate(all(a),0)>accumulate(all(b),0)) cout << accumulate(all(a),0) <<endl;
   else cout << accumulate(all(a),0) <<endl;
}

C++: #include <stdio.h>
using namespace std;

int main(){
  int i0,i1,i2,i3,i4,i5;

  scanf("%d%d%d%d",&i0,&i1,&i2,&i3);  
  i4 = i0 + i1 + i2 + i3;

  scanf("%d%d%d%d",&i0,&i1,&i2,&i3);
  i5 = i0 + i1 + i2 + i3;

  if(i4 == i5) printf("%d\n",i4);
  else{  
    if(i4 < i5) printf("%d\n",i5);
    else printf("%d\n",i4);
  } 
}

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

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

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a,b,c,d,e,f,g,h,X,V;
    cin>>a>>b>>c>>d;
    cin>>e>>f>>g>>h;
    cin>>X>>V;
    X=a+b+c+d;
    V=e+f+g+h;
    if(X<V){
        cout<<V<<endl;
    }
    else{
        cout<<X<<endl;
    }
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

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

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

int main(void)
{
	int d[2] = {0, 0};
	int c;

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

	if(d[0] > d[1])
		cout << d[0];
	else
		cout << d[1];
	cout << endl;


	return 0;
}

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>

using namespace std;

int main(void){
  int input,suma=0,sumb=0,i;
  for(i=0;i<4;i++){
    cin>>input;
    suma+=input;
  }
  for(i=0;i<4;i++){
    cin>>input;
    sumb+=input;
  }
  cout<<((suma<sumb)?sumb:suma);
  return 0;
}

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

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