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<stdio.h>
int main(void)
{
	int a,b,i,x;
	a=0; b=0;
	for(i=0;i<4;i++){
		scanf("%d",&x);
		a=a+x;
	}
	for(i=0;i<4;i++){
		scanf("%d",&x);
		b=b+x;
	}
	if(a>b) printf("%d\n",a);
	else printf("%d\n",b);
	return 0;
}

C++: #import<cstdio>
int main(){int i,a,b,c;for(a=b=i=0;i<8;i++)scanf("%d",&c),i<4?a+=c:b+=c;printf("%d\n",(a>b)?a:b);}

C++: #include<iostream>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<climits>
#include<ctime>
#include<cstring>
#define REP(i,p,n) for(int i=p;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))
#define all(c) (c).begin(), (c).end()

using namespace std;
template<class T> inline void chmax(T& a, T b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, T b) { if(b < a) a = b; }

int main() {
	int one;	
	int A,B;
	rep(i,4) {
		cin >> one;
		A+=one;
	}
	rep(i,4) {
		cin >> one;
		B+=one;
	}
	if (A > B) {
		cout << A << endl;
	}
	else {
		cout << B << endl;
	}

	return 0;
}

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

int main(){
  int ten_a,ten_b;
  int ans_a=0,ans_b=0,ans_big;
  for(int i=0;i<4;i++){
    cin >> ten_a;
    ans_a += ten_a;
  }
  for(int i=0;i<4;i++){
    cin >> ten_b;
    ans_b += ten_b;
  }
  cout << max(ans_a,ans_b) << endl;
}

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

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

using namespace std;

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

C++: #include<stdio.h>
int main(void)
{
	int S,T,ST,a,b,c,d,e,f,g,h;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	scanf("%d %d %d %d",&e,&f,&g,&h);
	S=a+b+c+d;
	T=e+f+g+h;
	if(S<T){
		printf("%d\n",T);
	}
	else{
		printf("%d\n",S);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int s,ss,sss;
	while(1){
		scanf("%d",&s);
		if(s==0) break;
		ss=1000-s;
		sss=ss/500;

		ss=ss%500;
		sss+=ss/100;

		ss=ss%100;
		sss+=ss/50;

		ss=ss%50;
		sss+=ss/10;

		ss=ss%10;
		sss+=ss/5;

		ss=ss%5;
		sss+=ss/1;

	printf("%d\n",sss);
	}
	return 0;
}

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

int main(){
	int a, b, c, d, w, x, y, z;
	scanf("%d %d %d %d %d %d %d %d", &a, &b, &c, &d, &w, &x, &y, &z);

	int t;
	t = max(a + b + c + d, w + x + y + z);

	printf("%d\n", t);

	return 0;
}

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

using namespace std;

namespace _{struct _{_(){ // initialize
  cin.tie(0); ios::sync_with_stdio(false);
}}_;}
template <typename T, size_t size>
inline size_t len(const T (&)[size]) { return size; }
#define println(s) cout << s << '\n';
#define str to_string
#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()


int main() {
  int a, b, c, d;
  int x, y, z, w;
  cin >> a >> b >> c >> d;
  cin >> x >> y >> z >> w;
  cout << max(a+b+c+d, x+y+z+w) << '\n';
  return 0;
}

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

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

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

using namespace std;

int main() {
	int A=0, B=0, t;

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

int main(){

	int score[2][4];
	int sum_A=0;
	int sum_B=0;

	for (int i = 0; i < 2; i++){
		for (int j = 0; j < 4; j++){
			cin >> score[i][j];
		}
	}

	for (int i = 0; i < 4; i++){
		sum_A += score[0][i];
		sum_B += score[1][i];
	}

	if (sum_A >= sum_B){
		cout << sum_A<<endl;
	}
	else {
		cout << sum_B<<endl;
	}
	//getchar();

	return 0;
}

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


int main(){

  int a1,a2,a3,a4,b1,b2,b3,b4;
  cin >> a1 >> a2 >> a3 >> a4;
  cin >> b1 >> b2 >> b3 >> b4;

  int sa = a1 + a2 + a3 + a4;
  int sb = b1 + b2 + b3 + b4;

  if(sa > sb) cout << sa << endl;
  else cout << sb << endl;

}

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

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c,d;
	c=0;
	d=0;
	for (a=0;a<4;a++)
	{
		cin>>b;
		c=c+b;
	}
	for (a=0;a<4;a++)
	{
		cin>>b;
		d=d+b;
	}
	if (d>c)
	{
		cout<<d;
	}
	else if (d<c)
	{
		cout<<c;
	}
	return 0;
}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 
 using namespace std;
  
 int main()
 {
   int a[4],b[4];
   int sum1,sum2;
   while(cin>>a[0])
   {
     sum1=sum2=0;
     for(int i=1;i<4;i++) cin>>a[i];
     for(int i=0;i<4;i++) cin>>b[i];
     for(int i=0;i<4;i++) sum1+=a[i];
     for(int i=0;i<4;i++) sum2+=b[i];
     if(sum1>sum2) cout<<sum1<<endl;
     else cout<<sum2<<endl;                
   }
   //while(1);      
   return 0;    
 }

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

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <valarray>
#include <algorithm>
#include <time.h>
#include <cstdlib>
#include <iomanip>
#include <stdlib.h>

using namespace std;

int main (void)
{
	int a[3],b[3],A,B;

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

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

	if (A <= B)
	{
		cout << B - 1 << endl;
	}
	else if (A > B)
	{
		cout << A - 1 << endl;
	}
}