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)
{
        int a1, a2, a3, a4, a;
        int b1, b2, b3, b4, b;
        cin >> a1 >> a2 >> a3 >> a4;
        cin >> b1 >> b2 >> b3 >> b4;
        a = a1 + a2 + a3 + a4;
        b = b1 + b2 + b3 + b4;

        if(a < b)
                cout << b << endl;
        else if(a > b)
                cout << a << endl;
        else
                cout << a << endl;

        return (0);
}

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

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

//-----------------------------------------------------------------------------


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

	int a=0,b=0;
	REP(i,4) {
		int A;cin>>A;a+=A;
	}
	REP(i,4) {
		int B;cin>>B;b+=B;
	}
	cout<<max(a,b)<<endl;

	return 0;
}

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

int main(){
	int N;
	int S, T;
	
	S = T = 0;
	
	for(int i = 0; i < 2; i++){
		for(int j = 0; j < 4; j++){
			cin >> N;
			if(i == 0) S += N;
			else T += N;
		}
	}
	
	cout << max(S, T) << endl;
	
	return 0;
}

C++: #include <bits/stdc++.h>

int main() {
    int t, a=0, b=0;
    for (int i = 0; i < 4; i++) {
        std::scanf("%d", &t);
        a += t;
    }
    for (int i = 0; i < 4; i++) {
        std::scanf("%d", &t);
        b += t;
    }
    (a > b) ? std::cout << a << std::endl : std::cout << b << std::endl;
    
    
    return 0;
}

C++: #include <studio.h>

int q,w,e,r,t,y,u,i;

C++: #include<iostream>
using namespace std;
int main()
{
	int a, b, c, d, sum[2];
	for (int i = 0; i < 2; i++)
	{
		cin >> a >> b >> c >> d;
		sum[i] = a + b + c + d;
		if (sum[0] < sum[i])
		{
			for (int j = 0; j < 1; j++)
			{
				swap(sum[i], sum[0]);
			}
		}
	}
	cout << sum[0];
}

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

C++: #include<iostream>
using namespace std;
int main(){
  int ei,ma,sc,en;
  int max=0,nm;
  for(int i=0;i<2;i++){
    cin>>ei>>ma>>sc>>en;
    nm=ei+ma+sc+en;
    if(max<nm){
      max=nm;
    }
  }
  cout<<max<<endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  int gotiusa=a+b+c+d;
  cin>>a>>b>>c>>d;
  int ujimatu=a+b+c+d;
  cout<<(gotiusa>ujimatu ?gotiusa:ujimatu )<<endl;
}

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

int a, b;

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

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);

	if(s>=s1){
		printf("%d\n",s);
	}
	else if(s<s1){
		printf("%d\n",s1);
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <queue>
#include <stack>
#include <set>

using namespace std;

#define ALL(co) co.begin(), co.end()
#define tpl(...) make_tuple(__VA_ARGS__)

typedef long long LL;
typedef pair<int, int> P; typedef pair<int, P> IP; typedef pair<P, P> PP;
typedef vector<int> Array; typedef vector<vector<int> > Array2;
typedef vector<LL> LArray; typedef vector<P> PArray; typedef vector<string> SArray;

const int INF = 1 << 29;
const LL LINF = 1LL << 60;

inline int getInt() { int itiv; return (cin >> itiv, itiv); }
template <typename T> void readAll(vector<T>& vec) { for (int i = 0, size = vec.size(); i < size; i++) cin >> vec[i]; }
template <typename T, typename U> void readAll(vector<pair<T, U> >& vec) { for (int i = 0, size = vec.size(); i < size; i++) cin >> vec[i].first >> vec[i].second; }
template < typename T > inline string toString( const T &a ){ ostringstream oss; oss << a; return oss.str(); };
inline bool between(int min, int max, int n) { return min <= n && n <= max; }
inline bool inRange(int begin, int end, int n) { return begin <= n && n < end; }
inline bool inRange(int size, int n) { return 0 <= n && n < size; }

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

int m, n;

int main(void)
{
	ios::sync_with_stdio(false);
	Array a(4), b(4);
	readAll(a);
	readAll(b);
	cout << max(*max_element(ALL(a)),*max_element(ALL(b))) << endl;
	return 0;
}

C++: /*
	AOJ 0510 JOI yo 2005 2006 1 Score
*/

//ミスを防ぐためにまずは基本のIncludeをすべて格納する

#include<fstream>
#include<iostream>
#include<string>
#include<queue>
#include<algorithm>
#include<set>
#include<map>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<vector>
#define INF (1<<21)
using namespace std;
typedef pair<int,int> P;

//ここまで基本型、多少の変更はあるけどまあいける

int main()
{
	int a[4],b[4];
	int asum,bsum;


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

	asum=a[0]+a[1]+a[2]+a[3];
	bsum=b[0]+b[1]+b[2]+b[3];

	int high;

	high=asum;
	if (bsum>asum) {high = bsum;}
	
	cout<<high;

	return 0;
}

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

C++: #include<iostream>
using namespace std;
int main()
{
	int a, b, c, d, sum[2];
	for (int i = 0; i < 2; i++)
	{
		cin >> a >> b >> c >> d;
		sum[i] = a + b + c + d;
		if (sum[0] < sum[i])
		{
			for (int j = 0; j < 1; j++)
			{
				swap(sum[i], sum[0]);
			}
		}
		if (sum[0] > sum[i])
		{
			for (int j = 0; j < 1; j++)
			{
				swap(sum[0], sum[i]);
			}
		}
	
	}
	if (sum[0] == sum[1])
	{
		cout << sum[0] << endl;
		return 0;
	}
	cout << sum[0] << endl;
}

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

C++: /*#include <studio.h>

int main(){
int q,w,e,r,t,y,u,i;
scanf("%d%d%d%d",&q,&w,&e,&r);
scanf("%d%d%d%d",&t,&y,&u,&i);

printf("%d",(q+w+e+r>=t+y+u+i?q+w+e+r:t+y+u+i));

return 0;
}*/

#include <studio.h> int main() { printf("Hello!"); return 0; }

C++: 111

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<iomanip>
using namespace std;
#define pi 3.141592653589793283462
int main(){
	int Aa,Ab,Ac,Ad;
	int ba,bb,bc,bd;
	int p,q;
	cin>> Aa>>Ab>>Ac>>Ad;
	cin>> ba>>bb>>bc>>bd;
	p=Aa+Ab+Ac+Ad;
    q=ba+bb+bc+bd;
	if(p<q)
		cout<<q<<endl;
	else if(p>q)
		cout<<p<<endl;
	else
		cout<<p<<endl;
	return 0;
}

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

using namespace std;

int main(){
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  int ans = a+b+c+d;
  cin>>a>>b>>c>>d;
  ans = max(ans, a+b+c+d);
  cout << ans << endl;
  return 0;
}