Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"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 main() {
	scanner.Split(bufio.ScanWords)
	points := make([]int, 6)
	for i := 0; i < 6; i++ {
		points[i] = nextInt()
	}
	// fmt.Println(points)
	sort.Slice(points[:4], func(i, j int) bool { return points[i] > points[j] })
	// fmt.Println(points)
	points2 := points[4:]
	sort.Slice(points2, func(i, j int) bool { return points2[i] > points2[j] })
	// fmt.Println(points)

	fmt.Println(points[0] + points[1] + points[2] + points2[0])
}

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

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

int main(){
	int ar[4];
	int ara[2];
	
	cin>>ar[0]>>ar[1]>>ar[2]>>ar[3]>>ara[1]>>ara[0];
	sort(ar,ar+4);
	sort(ara,ara+2);
	cout<<ar[1]+ar[2]+ar[3]+ara[1]<<endl;
	
	return 0;
	}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
  if (n & 1) res = res * x % mod;
  return res;
}

int main() {
    ll sum = 0, min1 = INF, min2 = INF;
    ll a;
    rep(i, 4) {
        cin >> a;
        sum += a;
        min1 = min(min1, a);
    }
    rep(i, 2) {
        cin >> a;
        sum += a;
        min2 = min(min2, a);
    }
    cout << sum-min1-min2 << endl;
}

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

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c[100]={0},d,e=0,f=0,g,h,i;
	for (a=0;a<4;a++)
	{
		cin>>b;
		c[b]=1;
	}
	for (a=99;a>0;a--)
	{
		if (c[b]==1&&e!=3)
		{
			f=f+b;
			e++;
		}
	}
	cin>>d>>e;
	if (d>=e)
	{
		g=d+f;
	}
	else
	{
		g=e+f;
	}
	cout<<g<<endl;
	return 0;
}

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

#define PI 3.1415926
void swap(int* x, int* y) {
	int a = *x;
	int b = *y;
	*x = b;
	*y = a;
}
int factorial(int n);
int sum(int n, int*);
int ave(int n, int*);
int min(int n, int*), min(int n, int m);
int max(int n, int*), max(int n, int m);

int main() {
	int s[10] = { 0 }, h[10]{ 0 };
	scanf("%d %d %d %d %d %d", &s[0], &s[1], &s[2], &s[3], &h[0], &h[1]);
	
	printf("%d\n", sum(4,s)- min(4, s)+max(2,h) );
	return 0;
}

int factorial(int n) {
	if (n > 0) {
		return n * factorial(n - 1);
	}
	else {
		return 1;
	}
}
int sum(int n, int *all) {
	int total = 0;
	for (int i = 0; i < n; ++i) {
		total += all[i];
	}
	return total;
}
int ave(int n, int *all) {
	int total = 0;
	for (int i = 0; i<n; ++i) {
		total += all[i];
	}
	return total / n;
}
int min(int n, int *all) {
	int min = all[0];
	for (int i = 1; i < n; ++i) {
		if (min > all[i]) {
			min = all[i];
		}
	}
	return min;
}
int max(int n, int *all) {
	int max = all[0];
	for (int i = 1; i<n; ++i) {
		if (max<all[i]) {
			max = all[i];
		}
	}
	return max;
}
int max(int n, int m) {
	if (n >= m) {
		return n;
	}
	else {
		return m;
	}
}
int min(int n, int m) {
	if (n >= m) {
		return m;
	}
	else {
		return n;
	}
}

C++: #include <iostream>

using namespace std;

#define MIN(a,b) ((a)<(b)?(a):(b))

int main()
{
    int P;
    int minR=200,minS=200;
    int total=0;

    for(int i=0; i<4; ++i) {
        cin >> P;
        total+=P;
        minR=MIN(P,minR);
    }
    for(int i=0; i<2; ++i) {
        cin >> P;
        total+=P;
        minS=MIN(P,minS);
    }
    cout << total - minR - minS << endl;
    return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.answer"
int main() {
	int sum = 0;
	vector<int>as(4), bs(2);
	for (int i = 0; i < 4; ++i) {
		cin >> as[i];
		sum += as[i];
	}
	cin >> bs[0] >> bs[1];
	sum += bs[0] + bs[1];
	sum -= *min_element(as.begin(), as.end()) + *min_element(bs.begin(), bs.end());
	cout << sum << endl;

	return 0;
}

C++: // ?????±???????????????????????? 2015-1
#include<cstdio>
#include<algorithm>
using namespace std;
 
 
int main(){
  int a[4],b[2];
  for(int i=0;i<4;i++) scanf("%d",a+i);
  for(int i=0;i<2;i++) scanf("%d",b+i);
  sort(a,a+4);
  sort(b,b+2);
  int ans = 0;
  for(int i=3;i>0;i--) ans+=a[i];
  ans+=b[1];
  printf("%d\n",ans);
  return 0;
}

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

int A, B, C, D, E, F;
int ans;

int main(void) {
	scanf("%d%d%d%d%d%d", &A, &B, &C, &D, &E, &F);
	ans = A + B + C + D + E + F;
	ans -= std::min(std::min(A, B), std::min(C, D));
	ans -= std::min(E, F);
	printf("%d\n", ans);
	return 0;
}

C++: #include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n;i>=0;i--)
#define INF 100000005
#define MAX 1002
#define mp make_pair
#define pb push_back
#define fi first
#define se second
using namespace std;
//__gcd(a,b), __builtin_popcount(a);

int main(){
	int a[4], b[2], ans = 0;
	rep(i,4)scanf("%d", &a[i]);
	scanf("%d%d", &b[0], &b[1]);
	sort(a, a+4);sort(b, b+2);
	ans = a[1]+a[2]+a[3]+b[1];
	printf("%d\n", ans);
	return 0;
}

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

int main() {
  int score[6];
  for (int i = 0; i < 6; i++) {
    cin >> score[i];
  }

  int sum = 0;
  for (int i = 0; i < 6; i++) {
    sum += score[i];
  }
  
  int mini;
  mini = score[0];
  for (int i = 0; i <= 3; i++) {
    if (score[i] < mini) mini = score[i];
  }
  sum -= mini;

  if (score[4] < score[5]) mini = score[4];
  else mini = score[5];
  sum -= mini;

  cout << sum << endl;

  return 0;
}

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

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

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