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>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
	int a, b, c, d; cin >> a >> b >> c >> d;
	int e, f, g, h; cin >> e >> f >> g >> h;
	ll ans1 = a + b + c + d;
	ll ans2 = e + f + g + h;

	cout << max(ans1, ans2) << endl;
}

C++: #include<iostream>

int s, t;

int main()
{
	int x;
	for( int i = 0; i < 4; i++ ){
		std::cin >> x;
		s += x;
	}
	
	for( int i = 0; i < 4; i++ ){
		std::cin >> x;
		t += x;
	}
	
	std::cout << std::max( s, t ) << std::endl;
	
 	return 0;
}

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

int main(){
int a,b,c,d,A,B;
cin>>a>>b>>c>>d;
A=a+b+c+d;
cin>>a>>b>>c>>d;
B=a+b+c+d;
if(A<B){A=B;}
cout<<A<<endl;}

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

int main() {
  int a, b, s, t;
  s = 0;
  t = 0;
  int i;
  for (i = 0; i < 4; i++) {
    cin >> a;
    s += a;
  }
  for (i = 0; i < 4; i++) {
    cin >> b;
    t += b;
  }
  cout << max(s, t) << endl;
  return 0;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
 
int main(){
    int A = 0;
    int B = 0;
    int buf;
    for(int a = 0; a < 4; a++){
        scanf("%d", &buf);
        A += buf;
    }
    for(int a = 0; a < 4; a++){
        scanf("%d", &buf);
        B += buf;
    }
    printf("%d\n", max(A, B));
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
const int inf=1e9+7;
const ll INF=1LL<<61;
const ll mod=1e9+7;

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

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

}

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

int main(void){
   int a1,a2,a3,a4;
   cin >> a1;
   cin >> a2;
   cin >> a3;
   cin >> a4;
   int S=a1+a2+a3+a4;
   int b1,b2,b3,b4;
   cin >> b1;
   cin >> b2;
   cin >> b3;
   cin >> b4;
   int T=b1+b2+b3+b4;
   
   if(S < T){
      cout << T << endl;
    }
    else if(T < S) {
      cout << S << endl;
       }
    else{
        cout << T << endl;
    }
   }

C++: #include<stdio.h>
int main()
{
	int t=0, s=0,b, a=0,i,j;
	for (j = 0; j < 4; j++) {
		scanf("%d", &a);
		s = a + s;
	}
	for (i = 0; i < 4; i++) {
		scanf("%d", &b);
		t = b + t;
	}
	if (s> t) {
		printf("%d\n",s);
	}
	else {
		printf("%d\n", t);
	}
}

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
#include<limits.h>
#include<unordered_map>
#include<unordered_set>
#include<deque>
#include<cstdio>
typedef long long int ll;
using namespace std;
#define FOR(i,a,n) for(int i=(ll)a;i<(ll)n;++i)
#define TFOR(i,n)FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define ipair pair<int,int>
const int INF = 1LL << 30;
const ll LLINF = 1LL << 60;
int main() {
	int a=0, b=0;
	TFOR(i, 4) {
		int n;
		cin >> n;
		a += n;
	}
	TFOR(i, 4) {
		int n; cin >> n;
		b += n;
	}
	cout << max(a, b) << endl;
	return 0;
}

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

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

using namespace std;

int main() {
    int ans = 0, sum, a;
    for (int i = 0; i < 2; ++i) {
        sum = 0;
        for (int j = 0; j < 4; ++j) {
            cin >> a;
            sum += a;
        }
        ans = max(ans, sum);
    }
    
    cout << ans << endl;
    
    return 0;
}

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

int main(){
	int a[4],b[4];
	int s,t;
	for(int i=0;i<4;i++)cin>>a[i];
	for(int j=0;j<4;j++)cin>>b[j];
	s=a[0]+a[1]+a[2]+a[3];
	t=b[0]+b[1]+b[2]+b[3];
	if(s>t)cout<<s;
	else cout<<t;
}

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

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,k,n) for(int i=k;i<(int)n;i++)
#define rei(n) for(int i=0;i<(int)n;i++)
#define rel(n) for(int l=0;l<(int)n;l++)
#define all(s) s.begin(),s.end()
#define INT_MAX 2147483647
#define debug(x) cout<<#x<<": "<<x<<endl;
#define PI 2*acos(0,0)
#define pb push_back
#define inin(x) int x; cin>>x;
#define ll long long
#define pb push_back

typedef pair<int, int> pii;
typedef pair<int, pii> pipii;

int main()
{
	int a = 0, b = 0;
	rep(i, 4)
	{
		inin(x); a += x;
	}
	rep(i, 4)
	{
		inin(x); b += x;
	}
	cout << max(a, b) << endl;

}

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

typedef long long ll;
typedef pair<int, int> P;

int MOD=1e9+7;
ll INF=1e18;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};

int main(){
    int a, b, c, d; cin>>a>>b>>c>>d;
    int i, j, k, l; cin>>i>>j>>k>>l;
    cout << max(a+b+c+d, i+j+k+l) << endl;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<set>
 
#include<stdio.h>
 
using namespace std;
 
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define pb push_back
#define read(a) scanf("%d",&(a))
#define write(a) printf("%d",(a))
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;
int main() {
	int a[4],b[4];
	rep(i,4) read(a[i]);
	rep(i,4) read(b[i]);
	int suma=0, sumb=0;
	rep(i,4) suma+=a[i];
	rep(i,4) sumb+=b[i];
	write(max(suma,sumb));
}