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

C++: #include<iostream>
#include<numeric>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
int main(){
	int a[4],b[4];
	REP(i,4)cin>>a[i];
	REP(i,4)cin>>b[i];
	cout<<max(accumulate(a,a+4,0), accumulate(b,b+4,0))<<endl;
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;
const int N = 4;

int main() {
  int a = 0, b = 0;
  REP(i, N) { int tmp; cin >>tmp; a += tmp; }
  REP(i, N) { int tmp; cin >>tmp; b += tmp; }
  cout <<max(a, b) <<endl;
  return 0;
}

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int A = 0, B = 0 , pt;
  for(int i = 0 ; i < 4 ; i++ ) cin >> pt , A += pt;
  for(int j = 0 ; j < 4 ; j++ ) cin >> pt , B += pt;
  cout << max(A,B) << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <array>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(i = (a); i < (b); i++)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define vvint vector<vector<int>>
#define vsort(x) sort(x.begin(),x.end())

using int64 = uint64_t;

using namespace std;

int main() {

	int i, j, k;
	int a[8];
	rep(i, 0, 8)
		cin >> a[i];
	int x=0, y=0;
	rep(i, 0, 4)
		x += a[i];
	rep(i, 4, 8)
		y += a[i];
	cout << max(x, y) << endl;
	return 0;
}

C++: #include <iostream> // C++の入出力
#include <stdio.h> // C の入出力
#include <algorithm> // sort などのアルゴリズム
#include <string.h> // C の文字列用
#include <ctype.h> // C の文字種用
#include <string> // C++の文字列
using namespace std;
int main(void){
    int sum,a,b,c,d;
    cin>>a>>b>>c>>d;
    sum=a+b+c+d;
    cin>>a>>b>>c>>d;
    if(sum>a+b+c+d)cout<<sum;
    else cout<<a+b+c+d;
    puts("");
    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)<<endl;
  return 0;
}

C++: // 2011/12/12 Tazoe

#include <iostream>
using namespace std;

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

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

	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(void)
{
	int a,b,c,d,e,f,g,h,x,y;
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);
	scanf("%d",&e);
	scanf("%d",&f);
	scanf("%d",&g);
	scanf("%d",&h);
	x=a+b+c+d;
	y=e+f+g+h;
	if(x>=y){
		printf("%d\n",x);
	}
	else{
		printf("%d\n",y);
	}
	
	return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
  int s, A = 0, B = 0;
  for(int i = 0; i < 4; ++i) {
	cin >> s;
	A += s;
  }
  for(int i = 0; i < 4; ++i) {
	cin >> s;
	B += s;
  }
  cout << (A >= B ? A : B) << 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 << endl;
	}else{
		cout << b << endl;
	}
	
	return 0;
}

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

int main(){
  int i,a,b,sum1=0,sum2=0;

  for(i=0;i<4;i++){
    cin>>a;    
    sum1+=a;
  }
  for(i=0;i<4;i++){
    cin>>b;    
    sum2+=b;
  }
  if(sum1<sum2)cout<<sum2<<endl;
  else cout<<sum1<<endl;
  

return 0;
}

C++: #include <stdio.h>

int main() {
    int a_sum, a1, a2, a3, a4;
    int b_sum, b1, b2, b3, b4;

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

    a_sum = a1 + a2 + a3 + a4;
    b_sum = b1 + b2 + b3 + b4;

    printf("%d\n", (a_sum>b_sum)?a_sum:b_sum);
}

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

int main(){
	int a[4],b[4],sum_a=0,sum_b=0;

	cin >> a[0] >> a[1] >> a[2] >> a[3];
	cin >> b[0] >> b[1] >> b[2] >> b[3];

	for(int i=0; i<4; ++i){
		sum_a += a[i];
		sum_b += b[i];
	}

	if(sum_a >= sum_b){
		cout << sum_a << endl;
	}else{
		cout << sum_b << endl;
	}
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define FOR( v, c ) for ( auto &v : c )

#define EACH( it, c ) for ( auto it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

int solve()
{
	int res = 0;
	REP( i, 0, 4 )
	{
		int tmp;
		cin >> tmp;
		res += tmp;
	}
	return res;
}

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

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

	return 0;
}

C++: #include <bits/stdc++.h>
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;
}