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<cstdio>
#include<iostream>
#include<queue>
#include<stack>
#define MAX_N 100000000

using namespace std;

int main(){
    struct A{
        int score[5];
        int ans=0;
    } A;

    struct B{
        int score[5];
        int ans=0;
    } B;

    for(int i=0;i<4;++i){
        cin>>A.score[i];
        A.ans+=A.score[i];
    }

    for(int i=0;i<4;++i){
        cin>>B.score[i];
        B.ans+=B.score[i];
    }

    A.ans>=B.ans ? cout<<A.ans<<endl : cout<<B.ans<<endl;

    return 0;
}

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

C++: #include <cstdio>
main(){
	int a[4],ar[3],n=2;
	for(;n;n--){
	scanf("%d%d%d%d",a,a+1,a+2,a+3);
	ar[n]=*a+a[1]+a[2]+a[3];
	}
	printf("%d\n",ar[1]>ar[2]?ar[1]:ar[2]);
}

C++: #include <cstdio>

int main (int argc, char const* argv[])
{
	int a=0,b=0;
	
	for (unsigned int i = 0; i < 4; i += 1)
	{
		int c;
		scanf("%d",&c);
		a+=c;
	}
	
	
	for (unsigned int i = 0; i < 4; i += 1)
	{
		int c;
		scanf("%d",&c);
		b+=c;
	}
	
	printf("%d\n",(a>b)?a:b);
	
	return 0;
}

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

using namespace std;

int main(void){

	int ans=0;
	int sum;
	int inp;

	for(int i=0;i<2;i++){
		sum=0;
		for(int j=0;j<4;j++){
			cin>>inp;
			sum+=inp;
		}
		ans=max(ans,sum);
	}

	cout<<ans<<endl;

	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
  int a=0;
  int temp;
  for(int i=0;i<4;i++){
    cin >> temp;
    a+=temp;
  }
  //int b=0;
  int ab=a;
  for(int i=0;i<4;i++){
    cin >> temp;
    ab-=temp;
  }
  if(ab<0){
    cout <<(a-ab)<<endl;
  }else{
      cout << a<< endl;
    }
}

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

int main(){
	int a[2];
	for(int i = 0; i < 2; i++){
		a[i] = 0;
		for(int j = 0; j < 4; j++){
			int t; scanf("%d", &t);
			a[i] += t;
		}
	}
	printf("%d\n", max(a[0],a[1]));
}

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

int main(){
  int ja,jb,sa,sb,ra,rb,ea,eb,s,t;
  cin >> ja >> sa >> ra >> ea;
  cin >> jb >> sb >> rb >> eb;

  s=ja+sa+ra+ea;
  t=jb+sb+rb+eb;

  if (s>t) {
    cout << s << endl;
  } else {
    cout << t << endl;
  }

  return 0;
}

C++: #include<iostream>
using namespace 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;
if(S<T) cout<<T;

return 0;
}

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

using namespace std;
int main() {
	int a,suma=0,sumb=0;
	for (int i = 0; i< 4; i++) {
		cin >> a;
		suma += a;
	}

	for (int i = 0; i < 4; i++) {
		cin >> a;
		sumb += a;
	}

	if (suma > sumb) {
		cout << suma << endl;
	}
	else {
		cout << sumb << endl;
	}
	
	


	//getchar();
	//getchar();
}

C++: #include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 100000005
#define MAX 5001
using namespace std;
//__gcd(a,b), __builtin_popcount(a);

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

C++: #include <bits/stdc++.h>
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 b;
		cin >> b;
		sb += b;
	}
	cout << max(sa, sb) << endl;
	return 0;
}

C++: 
#include<iostream>
#include<vector>
#include <map>
#include <utility>
#include <algorithm>
#include <functional>
#include<string>

using namespace std;

int main() {
	int a, s, d, f, g, h, j, k;
	cin >> a >> s >> d >> f >> g >> h >> j >> k;
	if (a + s + d + f > g + h + j + k) {
		cout << a + s + d + f << endl;
	}
	else {
		cout << g + h + j + k << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <math.h>
#include <algorithm>

using namespace std;

int main(){
	int a1,a2,a3,a4,b1,b2,b3,b4,A=0,B=0;
	scanf("%d %d %d %d",&a1,&a2,&a3,&a4);
	scanf("%d %d %d %d",&b1,&b2,&b3,&b4);
	A = a1 + a2 + a3 + a4;
	B = b1 + b2 + b3 + b4;
	if(A > B){
		printf("%d\n",A);
	}else{
		printf("%d\n",B);
	}

    return 0;
}

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

int main(){
  int Ainfo,Amath,Ascien,Aeng,Atotal;
  int Binfo,Bmath,Bscien,Beng,Btotal;
  cin>>Ainfo>>Amath>>Ascien>>Aeng;
  cin>>Binfo>>Bmath>>Bscien>>Beng;
  Atotal=Ainfo+Amath+Ascien+Aeng;
  Btotal=Binfo+Bmath+Bscien+Beng;
  if(Atotal>=Btotal){
    cout<<Atotal<<'\n';
  }else{
    cout<<Btotal<<'\n';
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int j,m,s,e,score=0;
  for(int i=0;i<2;i++){
    cin >> j >> m >> s >> e;
    if(score<j+m+s+e) score = j + m + s + e;
  }
  cout << score << endl;
  return 0;
}

C++: #include<iostream>

int sum[2];

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

C++: 
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main(){
	int a=0,b=0,n;
	for(int i=0;i<4;i++){
		cin>>n;
		a=a+n;
	}
	for(int i=0;i<4;i++){
		cin>>n;
		b=b+n;
	}
	if(a>b){
		cout<<a<<endl;
	}
	else{
		cout<<b<<endl;
	}
	return 0;
}

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

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0510

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

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

using namespace std;
int main()
{
    int ax,ay,az,aw,bx,by,bz,bw;
    cin >> ax >> ay >> az >> aw >> bx >> by >> bz >> bw;
    int max=ax+ay+az+aw;
    if(max<bx+by+bz+bw){
        max=bx+by+bz+bw;
    }
    cout << max << endl;
    return 0;
}

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

#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()

using namespace std;

typedef pair<int, int> pii;
typedef unsigned long long ull;

const int S_N = 4;
const int P_N = 2;

int main(){
    int res = 0;
    rep(i, P_N){
        int sum = 0;
        rep(j, S_N){
            int score; cin >> score;
            sum += score;
            res = max(res, sum);
        }
    }
    cout << res << endl;

    return 0;
}

C++: #include <stdio.h>

int main(void) {
    int a1, a2, a3, a4, b1, b2, b3, b4, S, T;

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

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

    if (S > T) {
        printf ("%d\n", S);
    }
    else {
        printf ("%d\n", T);
    }

    return 0;
}

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

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

  cout << max(sum1, sum2) << endl;
}