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>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
	
	int a, b, a_sum, b_sum;
	
	a_sum = 0;
	b_sum = 0;
	
	for(int i = 0; i < 4; i++){
		cin >> a;
		a_sum += a;
	}
	
	for(int i = 0; i < 4; i++){
		cin >> b;
		b_sum += b;
	}
	
	if(a_sum > b_sum){
		printf("%d\n", a_sum);
	}else{
		printf("%d\n", b_sum);
	}
	
	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>
using namespace std;

int main {
    int S,T,a,b,i;
    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<bits/stdc++.h>
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
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 main(){
    int A=0,B=0;
    for(int i=0; i<4; i++){
        int a;
        cin >> a;
        A += a;
    }
    for(int i=0; i<4; i++){
        int b;
        cin >> b;
        B += b;
    }
    cout << max(A,B) << enld;
    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;
    cin>>a>>b>>c>>d>>e>>f;
   vector<int>v{a+b+c,d+e+f};
   sort(v.begin(),v.end());
   cout << v[0] <<" "<< v[1] << endl;
}

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

int main() {
	int a, b, c, d, e, f, g, h, s, t;
	cin >> a >> b >> c >> d >> 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>
using namespace std;
int main(void){
    int a,b;
    int suma=0,sumb=0;
    for(int i=0;i<4;i++){
        cin >> a;
        suma += a;
    }
    for(int i=0;i<4;i++){
        cin >> b;
        sumb += b;
    }
    if(sumb > suma){
        cout << sumb << endl;
    }else{
        cout << suma << endl;
    }
    
    
}

C++: #include<unordered_map>
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<chrono>
#include<cstdio>
#include<iomanip>
#include<algorithm>
#include<functional>
using namespace std;
typedef long long ll;
int main(){
	int a=0,b=0,c;
	for(int i=0;i<4;i++){
		cin>>c;
		a+=c;
	}
	for(int i=0;i<4;i++){
		cin>>c;
		b+=c;
	}
	cout<<max(a,b);
}

C++: #include<stdio.h>
int a,b;
int i;
int n;

int max(int x,int y){
	if(x>=y)return x;
	else return y;
}

int main(){
	a=0;
	b=0;
	for(i=0;i<4;i++){
		scanf("%d",&n);
		a+=n;
	}
	for(i=0;i<4;i++){
		scanf("%d",&n);
		b+=n;
	}
	printf("%d\n",max(a,b));
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <algorithm>
#include <functional>

using namespace std;

#define rep(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(itr,c) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

int main(){
  int A=0,B=0,i;

  rep(i,4){
    int t;
    scanf("%d",&t);
    A += t;
  }
  rep(i,4){
    int t;
    scanf("%d",&t);
    B += t;
  }

  cout << max(A,B) << endl;

  return 0;
}

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

int main()
{
  int s, t, n;

  s = t = 0;
  for (int i = 0; i < 4; i++){
    cin >> n;
    s += n;
  }
  for (int i = 0; i < 4; i++){
    cin >> n;
    t += n;
  }
  if (s <= t){
    cout << t << endl;
    return 0;
  }
  cout << s << endl;

  return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int a, b, c, d, suma = 0, sumb = 0;
	cin >> a >> b >> c >> d;
	suma = a + b + c + d;
	cin >> a >> b >> c >> d;
	sumb = a + b + c + d;
	if (suma > sumb) cout << suma << endl;
	else cout << sumb << endl;
}

C++: #include <array>
#include <iostream>
#include <algorithm>
using std::for_each;
using std::array;
using std::cout;
using std::endl;
using std::cin;

int main() {
	array<int,4> a,b;
	for_each(a.begin(),a.end(),[](int &s){cin >> s;});
	for_each(b.begin(),b.end(),[](int &s){cin >> s;});
	int sum_a = 0,sum_b = 0;
	for_each(a.begin(),a.end(),[&sum_a](int s)mutable{sum_a += s;});
	for_each(b.begin(),b.end(),[&sum_b](int s)mutable{sum_b += s;});
	cout << (sum_a >= sum_b ? sum_a : sum_b) << endl;
}

C++: #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
	int sum[2]={0};
  	for(int i=0; i<2; i++){
      int a,b,c,d;
      cin>>a>>b>>c>>d;
      sum[i]+=(a+b+c+d);
    }
  cout<<max(sum[0],sum[1])<<endl;
}

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

using namespace std;

int main() {
    int a[8];
    for (int i=0; i<8; ++i) cin >> a[i];
    cout << max(accumulate(a, a+4, 0), accumulate(a+4, a+8, 0)) << endl;
    return 0;
}

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

C++: #include <stdio.h>

int main(){
	int a,b,c,d,e,f,g,h,i,j;
		scanf("%d %d %d %d",&a,&b,&c,&d);
		scanf("%d %d %d %d",&e,&f,&g,&h);
		i=a+b+c+d;
		j=e+f+g+h;
		if(i==j){
			printf("%d\n",i);
		}else if(i<j){
			printf("%d\n",j);
		}else if(i>j){
			printf("%d\n",i);
		
	}
	return 0;
}

C++: // #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;
 
int main() {
    int S = 0, T = 0, N = 4;
    for(int i=0; i<2*N; i++) {
        int v; scanf("%d", &v);
        (i < N ? S : T) += v;
    }
    cout << max(S, T) << endl;
    return 0;
}