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(){
	int sum1 = 0, sum2 = 0, a1, a2;	
	for(int i = 0; i < 4; i++){
		cin >> a1;
		sum1 += a1;
	}
	for(int i = 0; i < 4; i++){
		cin >> a2;
		sum2 += a2;
	}

	if(sum1 >= sum2){
		cout << sum1 << endl;
	}else{
		cout << sum2 << endl;
	}

}

C++: #include <cstdio>

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

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

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

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

int main() {
	int a[4] = {}, b[4] = {};
	std::cin >> a[0] >> a[1] >> a[2] >> a[3];
	std::cin >> b[0] >> b[1] >> b[2] >> b[3];
	std::cout << std::max({ a[0] + a[1] + a[2] + a[3], b[0] + b[1] + b[2] + b[3] }) << std::endl;
	return 0;
}

C++: #include<cstdio>
using namespace std;
int main(void)
{
   int a = 0,b = 0,c;
   for(int i = 0;i < 4;i++)
   {
      scanf("%d",&c);
      a += c;
   }

   for(int i = 0;i < 4;i++)
   {
      scanf("%d",&c);
      b += c;
   }
   if(a>b) printf("%d\n",a);
   else printf("%d\n",b);
   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<stdio.h>
int main(void)
{
	int x1,x2,x3,x4,y1,y2,y3,y4,s,t;
	scanf("%d %d %d %d %d %d %d %d",&x1,&x2,&x3,&x4,&y1,&y2,&y3,&y4);
	s=x1+x2+x3+x4;
	t=y1+y2+y3+y4;
	if(s>t){
		printf("d\n",s);
	}
	else if(s<t){
		printf("%d\n",t);
	}
	else if(s==t){
		printf("%d\n",t);
	}
	return 0;
}

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

int main(){
  int A;
  int B;
  int S=0;
  int T=0;

  for(int i=0;i<4;++i){
    cin >> A;
    S+=A;
  }

  for(int i=0;i<4;++i){
    cin >> B;
    T+=B;
  }

  if(T>S) cout<<T<<endl;
  else cout<<S<<endl;
}

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

#define MAX 1100


using namespace std;

struct Data
{
	int n1 , n2 , n3 , n4;
};


int main()
{
	Data data1 , data2;

	cin >> data1.n1 >> data1.n2 >> data1.n3 >> data1.n4;
	cin >> data2.n1 >> data2.n2 >> data2.n3 >> data2.n4;

	cout << max((data1.n1 + data1.n2 + data1.n3 + data1.n4) , (data2.n1 + data2.n2 + data2.n3 + data2.n4)) << endl;

	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int i,j,s=0,t=0,a[4],b[4];
	for(j=0;j<2;j++)
	{
		for(i=0;i<4;i++)
		{
			if(j==0)
			{
				cin>>a[i];
				s=a[i]+s;
			}
			else
			{
				cin>>b[i];
				t=b[i]+t;
			}
		}
	}
	if(t<s)
	{
	 cout<<s<<endl;
	}
	else
	{
	cout<<t<<endl;
	}	
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
  int sum1 = 0, sum2 = 0;
  int n;
  for(int i = 0; i< 4; i++){
    cin >> n;
    sum1 += n;
  }
  for(int i = 0; i< 4; i++){
    cin >> n;
    sum2 += n;
  }

  if(sum1 > sum2) coout << sum1;
  else cout << sum2;

  return 0;
}

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

int sumar(int mat[4]){
	return mat[0]+mat[1]+mat[2]+mat[3];
}

int main(){
	int a[4];
	int b[4];
	while(cin>>a[0]>>a[1]>>a[2]>>a[3]){
		cin>>b[0]>>b[1]>>b[2]>>b[3];
		cout<<max(sumar(a),sumar(b))<<endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int a[4],b[4];
	for(int i=0;i<4;i++) cin >> a[i] ;
	for(int i=0;i<4;i++) cin >> b[i] ;
	int sa=0; int sb=0;
	for(int i=0;i<4;i++) sa+=a[i] ,sb+=b[i] ;
	if(sa>sb) cout << sa ;
	else cout << sb ;
	cout << '\n' ;
}

C++: #include<set>
using namespace std;
#include<iostream>
int	main(){

/*	int N, C, c[100], n;
	cin >> N;
	C = 0;
	n = 0;

	for (int i = 0; i <N; i++ ){
		cin >> c[i];
		C+= c[i];
	}

	for (int i = 0; i <N; i++ ){
		if (c[i] <= 0.1*C){
			n+= 30;
		}
	}
	cout << n << endl;
}
	/*
	while(true){
	
	int A,B,C,D,E,F,G,H,I,J,answer;
		
	cin >> A;
	if(A == 0) return 0;
	cin >> B >> C >> D >> E >> F >> G >> H >> I >> J;
	answer = A - B - C - D-E-F-G-H-I-J;
	cout << answer << endl;

	}
	*/
	/*
	int A,B,C,D,E,F;

	cin >> A, B, C, D;
	if(A < B, C, D){ 
		cout << B + C + D << endl;
	}
	
	else if(B < A, C, D){
		cout << A + C + D << endl;
	}

	else if(C < A && C < B && C < D){
		cout << A + B + D << endl;
	}

	else if(D < A && D < B && D < C){
		cout << A + B + C << endl;
	}

	if(E < F){
		cout << F << endl;
	}

	else{
		cout << E << endl;
	}
	
	return 0;
}*/
	/*
	int N, M;
	cin >> N >> M;
	cout << N + M << endl << N - M << endl << N * M << endl << N / M << endl;
}*/

/*int N, M; 
	cin >> N >> M;
	cout << N % M << endl;
}*/

/*	int N;
	cin >> N;
	cout << -(N % 2)+1 ;
}*/

	/*int A, B, C, D, E ;
	cin >> A >> B >> C >> D >> E;
	cout << (A + B + C + D + E) / 5 ;
}*/

	/*int A, B, C, D ;
	cin >> A >> B >> C >> D;
	cout << (A + B + C + D) / 60 << endl << (A + B + C + D) % 60 << endl;
	*/

/*	int A,B;
	cin >> A >> B;
	cout << ( A + B ) / 2 << endl;*/

/*	int m, f, b;
	cin >> m >> f >> b;

	if ( m + f >= b && m <= b ){
		cout << b - m << endl;
	}
	
	if ( m + f > b && m > b ){
		cout << 0 << endl;
	}


	if ( m + f < b ){
		cout << "NA" << endl;
	}*/

/*	int X , x ;
	cin >> X ;

	x = X % 7 ;

	if ( x == 2 ){
		cout << "sat" << endl;
	}

	if ( x == 3 ){
		cout << "sun" << endl;
	}

	if ( x == 4 ){
		cout << "mon" << endl;
	}

	if ( x == 5 ){
		cout << "tue" << endl;
	}

	if ( x == 6 ){
		cout << "wed" << endl;
	}

	if ( x == 0 ){
		cout << "thu" << endl;
	}

	if ( x == 1 ){
		cout << "fri" << endl;
	}*/

	/*int a , b , N ;
	cin >> a >> b >> N ;

	int s[100] , f[100];
	for ( int i=0 ; i<N ; i++ ){
		cin >> s[i] >> f[i];
	
		if (( s[i] <= a && a < f[i]) || s[i] < b && b <= f[i] || s[i] >= a && f[i] <= b ){
			cout << 1 << endl;
			return 0;
		}
	}
	cout << 0 << endl;
	return 0;
}*/

	/*int N, A, B, C;
	vector <int> a;
	vector <int> dp;

	int pizza (int C){
		if (C == N) return 0;
		if (dp[C]! = -1) return dp[C];
		dp[C] = max (pizza(C+1); pizza(C+1)+a[C]);
		return dp[C];
	}

		int main(){
			cin >> N;
			for(int i = 0; i<N; i++){
				int tmp;
				cin >> tmp;
				a.push_back(tmp);
				dp.push_back(-1);
			}
			cout << pizza(0) << endl;

			return 0;
	}
		cout << C[i]/(A+B);*/
	
/*	int main(){
		int N, A, B, C, a, dp, i;

		dp[i+1] = max(dp[i], dp[i]+a[]), C[0] = 0;
	}*/

/*	long long N;
	cin >> N;
	cout << 264 + 52 * N << endl;
}*/

	/*int H, W;
	cin >> H >> W;
	if (H * 4 == W * 3){
		cout << "YOKO" << endl;
	}

	else{
		cout << "TATE" << endl;
	}


	}*/


	/*int X, Y;
	cin >> X >> Y;
	int m, n, l;
			cin >> m >> n >> l;
	X/Y == m/n;

	if (X/l == m && Y/l == n && l != 1){
			cout << l*(m+n)+2-(l-1) << endl;
	}

	else {
		cout << X+Y << endl;
	}*/

	int i, m, s, e, I, M, S, E;
	cin >> i >> m >> s >> e >> I >> M >> S >> E;

	if(i + m + s + e >= I + M + S + E){
		cout << i + m + s + e << endl;
	}

	else{
		cout << I + M + S + E << endl;
	}
}

C++: #include<iostream>
using namespace std;
int main(){
int aa,ab,ac,ad,ba,bb,bc,bd,sum_a,sum_b;

cin>>aa>ab>>ac>>ad>>endl;
cin>>ba>>bb>bc>>bd>>endl;
sum_a=aa+ab+ac+ad;
sum_b=ba+bb+bc+bd;

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

return 0;
}