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 <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define rrep(i,n) for(int (i)=1;i<=(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define MOD 1000000007
#define INF 1e18
#define int long long
#define endl "\n"
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



signed main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	
	int a[6], sum = 0;
	rep(i, 6) cin >> a[i], sum += a[i];
	cout << sum - min({a[0], a[1], a[2], a[3]}) - min(a[4], a[5]) << endl;
	return 0;
}

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

using namespace std;

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

C++: #include <iostream>
#include <algorithm>
using namespace std;
int a, b, c, d, e, f;
int main() {
	cin >> a >> b >> c >> d >> e >> f;
	cout << a + b + c + d + e + f - min({ a, b, c, d }) - min(e, f);
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a[6],i,w,x,j;
	for(i=0;i<6;i++){
		scanf("%d",&a[i]);
	}
	for(i=0;i<3;i++){
		for(j=i+1;j<4;j++){
			if(a[i]<a[j]){
				w=a[i];
				a[i]=a[j];
				a[j]=w;
			}
		}
	}
	if(a[4]>a[5]){
		x=a[0]+a[1]+a[2]+a[4];
	}
	else{
		x=a[0]+a[1]+a[2]+a[5];
	}
	printf("%d\n",x);
	return 0;
}

C++: #include <iostream>
using namespace std;
int r[4];
int s[2];
int maxc,m;
int main(){
	cin >>r[0];
	cin >>r[1];
	cin >>r[2];
	cin >>r[3];
	cin >>s[0];
	cin >>s[1];
	maxc=r[0]+r[1]+r[2]+r[3]+s[0]+s[1];
	m=101;
	for(int i=0;i<4;i++){
		if(r[i]<m)m=r[i];
	}
	maxc-=m;
	m=101;
	for(int i=0;i<2;i++){
		if(s[i]<m)m=s[i];
	}
	maxc-=m;
	cout << maxc<<endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
    int A,B,C,D,E,F,G,H,I,g;
    cin>>A>>B>>C>>D>>E>>F;
    g=min(min(min(C,D),A),B);
    G=(A+B+C+D)-g;
    H=max(E,F);
    I=G+H;
    cout<<I<<endl;
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main(void) {
	int n, a, b, c, d, e;  
	cin >> n >> a >> b >> c >> d >> e;
	cout << n + a + b + c + d + e - min(a, min(b, min(c, n))) - min(d, e) << endl;
}

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

using namespace std;

int main(){
	int s1[4],s2[2];
	for(int i=0;i<4;i++){
		scanf("%d",&s1[i]);
	}
	for(int i=0;i<2;i++){
		scanf("%d",&s2[i]);
	}
	sort(s1,s1+4);
	sort(s2,s2+2);
	printf("%d\n",s1[3]+s1[2]+s1[1]+s2[1]);
}

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

#define ct cout
#define in cin
#define el endl
#define rep(i, N) for (int i = 0; i < N; i++)
#define ol(N) cout << N << endl

int main()
{
	int s1[4], s2[2];

	rep(i, 4){
		in >> s1[i];
	}
	in >> s2[0] >> s2[1];

	sort (s1, s1 + 4);
	reverse(s1, s1 + 4);

	ol(s1[0] + s1[1] + s1[2] + max(s2[0], s2[1]));

	return (0);
}

C++: #include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-10;
const vi emp;

vi a(6);

int main(){
	for(auto i=a.begin();i!=a.end();i++) cin>>*i;
	sort(a.begin(),a.begin()+4);
	sort(a.begin()+4,a.end());
	cout<<a[1]+a[2]+a[3]+a[5]<<endl;
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
int s[5];
int main()
{
	int i,j,a,b,q;
	for(i=1;i<=4;i++)cin>>s[i];
	cin>>a>>b;
	for(i=1;i<=4;i++)
	{
		for(j=i+1;j<=4;j++)
		{
			if(s[i]<s[j])
			{
				q=s[i];s[i]=s[j];s[j]=q;
			}
		}
	}
	if(a>b)cout<<s[1]+s[2]+s[3]+a<<endl;
	else cout<<s[1]+s[2]+s[3]+b<<endl;
	return 0;
}

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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second

int main()
{
    int a[4],b[2];
    rep(i,4) cin >>a[i];
    rep(j,2) cin >>b[j];

    sort(a,a+4,greater<int>());
    sort(b,b+2,greater<int>());

    printf("%d\n", a[0]+a[1]+a[2]+b[0]);
    return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

const char en = '\n';
using  ll =          long long;
using ull = unsigned long long;
#define REP(i  ,n) for(int i=0;i<n;i++)
#define FOR(i,s,g) for(int i=s;i<g;i++)
const ll INFL = 810810191911451400;
const int INF =       1919114514;

int main(){
	ios::sync_with_stdio(false);cin.tie();

	int sum=0,buf,MIN=INF;
	REP(i, 4){
		cin>>buf;
		sum+=buf;
		MIN=min(buf,MIN);
	}
	sum-=MIN;

	cin>>buf>>MIN;

	sum+=max(buf,MIN);

	cout<<sum<<en;
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int A,B,C,D,E,F,a,b,c,d;
    cin>>A>>B>>C>>D>>E>>F;
    a=max(E,F);
    b=max(max(A,B),max(C,D));
    c=min(max(A,B),max(C,D));
    d=max(min(A,B),min(C,D));
    cout<<a+b+c+d<<endl;
    
    
    
    return 0;
}

C++: // Example program
#include <iostream>
#include <string>
#include <math.h>
using namespace std;

int main()
{
  int scores[6];
  for (int i = 0; i < 6; i++) {
      cin >> scores[i];
  }
  int total = scores[0] + scores[1] + scores[2] + scores[3] + scores[4] + scores[5] - min(scores[0], (min(scores[1], min(scores[2], scores[3])))) - min(scores[4], scores[5]);
  cout << total << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int a[4],b[2];
    for(int i=0;i<4;i++){
        cin>>a[i];
    }
    for(int i=0;i<2;i++){
        cin>>b[i];
    }
    for(int i=0;i<3;i++){
        for(int j=0;j<4;j++){
            if(a[j]<a[j+1]){
                swap(a[j],a[j+1]);
            }
        }
    }
    if(b[1]<b[2]){
        swap(b[1],b[2]);
    }
    cout<<a[0]+a[2]+a[1]+b[1]<<endl;
    return 0;
}