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>
using namespace std;

int a, b, c, d, e, f, g, h;

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

C++: #include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std; 
int main(){
  int a,b,c,d;
  int w,x,y,z;
  cin>>a>>b>>c>>d;
  cin>>w>>x>>y>>z;
  int A=a+b+c+d;
  int B=w+x+y+z;
  if(A>B) cout<<a<<endl;
  else if(A<B) cout<<B<<endl;
  else  cout<<A<<endl;
  
return 0;
}

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

#define ALL(a) (a).begin(), (a).end()
#define ll long long

using namespace std;

signed main(){
	int a[2][4];
	for(int i = 0; i < 2; i++){
		for(int j = 0; j < 4; j++){
			cin >> a[i][j];
		}
	}
	int aa = 0,bb = 0 ;
	for(int i = 0; i < 4; i++){
		aa += a[0][i];
		bb += a[1][i];
	}
	if(aa > bb)cout << aa << endl;
	else cout << bb << endl;


	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int x1,x2,x3,x4,y1,y2,y3,y4,x,y;
	scanf("%d %d %d %d %d %d %d %d",&x1,&x2,&x3,&x4,&y1,&y2,&y3,&y4)
	x=x1+x2+x3+x4;
	y=y1+y2+y3+y4;
	if(x>y){
		printf("d\n",x);
	}
	else{
		printf("d\n",y);
	}
	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <conio.h>
using namespace std;

int main(){
	int tmp1,tmp2;
	int a=0,b=0;
	for(int i=0; i<4; ++i){
		cin >> tmp1;
		a += tmp1;	
	}
	for(int i=0; i,4; ++i){
		cin >> tmp2;
		b += tmp2;
	}
	if(a >= b){
		cout << a << endl;
	} else if(b > a){
		cout << b << endl;
	}

	return 0;
}

C++: #include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i;
  int a,b=0,c=0;
  for(i=0;i<4;i++){
    cin>>a;
    b+=a;
  }
  for(i=0;i<4;i++){
    cin>>a;
    c+=a;
  }
  cout<<(b>c?b:c)<<endl;
  return 0;
}

C++: #include<cstdio>

using namespace std;



int main(void){

	int S=0,T=0,s;

	for(int i=0;i<4;i++){
		scanf("%d",&s);
		S+=s;
	}
	for(int i=0;i<4;i++){
		scanf("%d",&s);
		T+=s;
	}
	if(S>T) printf("%d\n",S);
	else printf("%d\n",T);

	return 0;
}

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

int main(){
	int tmp, suma = 0, sumb = 0;
	for (int i = 0; i < 4; i++) {
		cin >> tmp;
		suma += tmp;
	}
	for (int i = 0; i < 4; i++) {
		cin >> tmp;
		sumb += tmp;
	}
	cout << max(suma, sumb);
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int a;
    int s = 0, t = 0;

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

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

    cout << (s < t ? t : s) << endl;
}

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

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

C++: #include<iostream>

using namespace std;

int main()
{
	int ans=0,ss=0;
	int i,a;
	
	for(i=0;i<4;i++)
	{
		cin >> a ;
		ans+=a;
	}
	for(i=0;i<4;i++)
	{
		cin >> a ;
		ss+=a;
	}
	if(ans>ss)
		cout << ans << endl;
	else
		cout << ss << endl;
}

C++: #include<cstdio>
#include<iostream>
int main(){
    int ap,bp,A=0,B=0;
    for(int i=0;i<4;i++){
        scanf("%d",&ap);
        A+=ap;
    }

    for(int i=0;i<4;i++){
        scanf("%d",&bp);
        B+=bp;
    }
    if(A>B)
        printf("%d\n",A);
    else
        printf("%d\n",B);
    return 0;
}

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

using namespace std;

int main() {
	int score;
	int sum[2];

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

	return 0;
}

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

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

C++: #include<iostream>
using namespace std;
int main() {
	int a[8];
	for (int i = 0; i < 8; i++) {
		cin >> a[i];
	}
	if (a[0] + a[1] + a[2] + a[3] > a[4] + a[5] + a[6] + a[7])cout << a[0] + a[1] + a[2] + a[3] << endl;
	else cout << a[4] + a[5] + a[6] + a[7];
}

C++: #include<iostream>
using namespace std;
int main()
{
	int S,T;
	int a,b,c,d,e,f,g,h;
	cin>>a>>b>>c>>d;
	cin>>e>>f>>g>>h;
	S=a+b+c+d;
	T=e+f+g+h;
	if(S<T){
	cout<<T<<endl;
	}
	else{
	cout<<S<<endl;
	}
	return 0;
}

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

int Sum(vector<int>& x) {
    int ret = 0;
    for (auto i : x) ret += i;
    return ret;
}

int main() {
    vector<int> a(4), b(4);
    for (auto& i : a) cin >> i;
    for (auto& i : b) cin >> i;
    cout << max(Sum(a), Sum(b)) << endl;

    return 0;
}

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

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) << 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 <iostream>
using namespace std;
int main(void)
{
	int a,b,c,d,e;
	c=0;
	d=0;
	for (a=0;a<4;a++)
	{
		cin>>e;
		c=c+e;
	}
	for (a=0;a<4;a++)
	{
		cin>>b;
		d=d+b;
	}
	if (d>=c)
	{
		cout<<d<<endl;
	}
	else if (d<=c)
	{
		cout<<c<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <fstream>
#include <algorithm>
#include <math.h>
#include <map>
using namespace std;

#define rep(i, n) for (int i = 0; i < n; i++)

bool has_key_using_count(map<char, char> &m, char n){
    if (m.count(n) == 0){
        return false;
    }
    else{
        return true;
    }
}

int main()
{
	//ifstream cin("sample.txt");

	int n = 4, sumA = 0, sumB = 0, t = 0, ans = 0;
	
	rep(i, n) {
		cin >> t;
		sumA += t;
	}
	rep(i, n) {
		cin >> t;
		sumB += t;
	}

	ans = (sumA >= sumB ? sumA : sumB);
	//cout << ans << endl;
	std::cout << ans << endl;

	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int x[2]={},a;
	for(int i=0;i<2;i++){
		for(int j=0;j<4;j++){
			cin>>a;
			x[i]+=a;
		}
	}
	cout<<max(x[0],x[1])<<endl;
return 0;
}

C++: #include<iostream>
#include <stdio.h>
using namespace std;
  
int main(){
	int a,b,c,d,e,f,g,h;
	cin>>a>>b>>c>>d>>e>>f>>g>>h;
	int i=a+b+c+d;
	int j=e+f+g+h;
	if(i>j){
		cout<<i<<endl;}else{
		cout<<j<<endl;}
    return 0;
    }