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>
#include <string>
#include <stdio.h>
#include <numeric>
#include <algorithm>
using namespace std;
int main(){
    int a=0,b=0;
    for(int i=0;i<4;++i){
        int n;
        cin>>n;
        a+=n;
    }
    for(int i=0;i<4;++i){
        int n;
        cin>>n;
        b+=n;
    }
    if(a>b){
        cout<<a<<endl;
    }
    else{
        cout<<b<<endl;
    }
    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);
	while(cin >> n && n)
	{
		Array a(4), b(4);
		readAll(a);
		readAll(b);
		cout << max(*max_element(ALL(a)),*max_element(ALL(b))) << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>

#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair

using namespace std;

/*
cin.tie(0);
ios::sync_with_stdio(false);
*/

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

/*---------------------------------------------------*/

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

C++: #include<iostream>

using namespace std;

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

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

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

int main() {
	int in;
	while(cin >> in) {
		if (in == 0) break;
		int p = 1000 - in;
		int ans = 0;
		int units[] = { 500, 100, 50, 10, 5, 1 };
		for (int i = 0; i < 6; i++) {
			ans += p /  units[i];
			p %= units[i];
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
	int sum1=0,sum2=0;
	for(int i=0;i<4;i++){
	cin>>a;
	sum1+=a;
}
for(int i=0;i<4;i++){
	cin>>a;
	sum2+=sum2;
}
	if(sum1>sum2)cout<<sum1;
	else if(sum1<sum2)cout<<sum2;
	else cout<<sum1;

return 0;
}

C++: #include<iostream>
using namespace std;
	int main(){
	int sum1=0,sum2=0;int a;
	for(int i=0;i<4;i++){
	cin>>a;
	sum1+=a;
}
for(int i=0;i<4;i++){
	cin>>a;
	sum2+=sum2;
}
	if(sum1>sum2)cout<<sum1;
	else if(sum1<sum2)cout<<sum2;
	else cout<<sum1;

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;
	}
	else {
		cout << sum_B;
	}
	//getchar();

	return 0;
}

C++: //0510:   Score

#include <iostream>
using namespace std;

#define NUM 1000

int main(){
  int s[NUM];
  int t[NUM];
  int sums = 0;
  int sumt = 0;
  int i;

  for (i = 0; i < 4; i++){
    cin >> s[i];
    sums += s[i];
  }

  for (i = 0; i < 4; i++){
    cin >> t[i];
    sumt += t[i];
  }

  if (sums > sumt){
    cout << sums << '\n';
  }
  else {
    cout << sumt <<'\n';
  }
return 0;
}

C++: #include<iostream>
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];
  int i,j;
  if((i=a[0]+a[1]+a[2]+a[3]) >= (j=b[0]+b[1]+b[2]+b[3])) {
    std::cout<<i<<std::endl;
  }else{
    std::cout<<j<<std::endl;
  }
}

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

int main(){
int W,X,Y,Z,w,x,y,z;
cin >> W >>X >> Y >> Z >> w >> x >>y >> z;

if( (W + X + Y + Z) > (w + x + y + z)){
    cout << W + X + Y + Z << endl;
}
else if(( W + X + Y + Z) < (w + x + y + z)){
    cout << w + x + y + z << endl;
}
else{ 
    cout << w + x + y + z << endl;
}

return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int s1,s2,s3,s4;
    int t1,t2,t3,t4;
    cin >> s1 >> s2 >> s3 >> s4;
    cin >> t1 >> t2 >> t3 >> t4;
    
    int S,T;
    S = s1+s2+s3+s4;
    T = t1+t2+t3+t4;
    
    if(S>=T){
        cout << S << endl;
    }
    
    else{
        cout << T << endl;
    }
}

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

int main()
{
    int a;
    int b;
    int c;
    int d;
    int e;
    int f;
    int g;
    int h;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    cin >> e;
    cin >> f;
    cin >> g;
    cin >> h;
    int S = a + b + c + d;
    int T = e + f + g + h;
    vector<int> v{S,T};
    sort(v.begin(),v.end());
    cout << v[1] << 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;
    }
    else if(y>x){
        cout << y;
    }
    else{
        cout << x;
    }
    cout << endl;
    
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c=0,d=0;
  for(int i=0;i<4;i++){
    cin >> a;
    c += a;
  }
  for(int i=0;i<4;i++){
    cin >> b;
    d += b;
  }
  if(c>d) cout << c << endl;
  else cout << d << 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\n";
else cout<<"T\n";
 
return 0;
}