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<algorithm>
#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
int main(void){
	int A[4]={0},B,C,SUM=0;
	for(int i=0;i<4;i++){
		cin>>A[i];
	}
	cin>>B>>C;
	sort(A,A+4);
	for(int i=3;i>0;i--){
		SUM+=A[i];
	}
	SUM+=max(B,C);
	cout<<SUM<<endl;
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cctype>
#include <climits>
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <memory>
#include <functional>

using namespace std;

#define ALL(a) (a).begin(), (a).end()
#define REP(index, begin, end) for (int (index) = (begin); (index) < (end); (index)++)
#define RE(index, end) REP(index, 0, end)
#define INF INT_MAX / 3
#define D(x) cout << #x << " = " << x << endl;

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

int main()
{
	array<int, 4> a;
	array<int, 2> b;
	int sum;
	RE(i, 4)
	{
		scanf("%d", &a[i]);
	}
	RE(i, 2)
	{
		scanf("%d", &b[i]);
	}
	sort(ALL(a), greater<int>());
	sum = max(b[0], b[1]);
	RE(i, 3)
	{
		sum += a[i];
	}
	printf("%d\n", sum);
	return 0;
}

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

int main(){
    int a,b,c,d,e,f;
    cin >> a >> b >> c >> d >> e >> f;
    
    cout << a + b + c + d + e + f - min(min(a,b),min(d,c)) - min(e,f) << endl;
    
}

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

int main() {
    int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f;
    cout << a + b + c + d - min({a,b,c,d}) + max(e, f) << endl;
}

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

using namespace std;

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

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=1<<18,INF=1<<29;

int main(){
  int a,b,c,d,e,f;cin>>a>>b>>c>>d>>e>>f;
  cout<<a+b+c+d+e+f-min({a,b,c,d})-min(e,f)<<endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
// #define int long long
typedef long long ll;
typedef pair<int,int> pii;
#define ITR(v,c) for(auto v=begin(c);v!=end(c);v++)
#define FOR(v,a,n) for(int v=a;v<(int)(n);v++)
#define FORE(x,arr) for(auto &x:arr)
#define REP(v,n) FOR(v,0,n)
#define RREP(v,n) for(int v=(int)(n);v>=0;v--)
#define ALL(c) begin(c),end(c)
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
const int INF = 1e9;
const ll INFLL = 1e18;
template<class T,class U>ostream&operator<<(ostream &os,const pair<T,U> &p){
    os<<"("<<p.first<<","<<p.second<<")";return os;}
template<class T>ostream&operator<<(ostream &os,const vector<T> &v){
    ITR(i,v)os<<*i<<(i==end(v)-1?"":" ");return os;}
//------------------------------------------------------------------------------

signed main() {
    vector<int> a(4),b(2);
    FORE(x,a) cin>>x;
    FORE(x,b) cin>>x;
    sort(ALL(a));
    sort(ALL(b));
    cout<<a[1]+a[2]+a[3]+b[1]<<endl;
    return 0;
}

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

using namespace std;

int main(){
	vector<int> score(6);
	for(int i = 0; i < 6; i++){
		cin >> score[i];
	}
	int science = score[0] + score[1] + score[2] + score[3];
	science -= min(min(score[0], score[1]),min(score[2], score[3]));
	
	cout << science + max(score[4], score[5]);
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int suma=0,sumb=0;
    int a[4],b[4];
    int mina=2999,minb=2999;
    for(int i=0;i<4;i++){
        cin>>a[i];
        if(mina>a[i]) mina=a[i];
        suma=suma+a[i];
    }
    for(int k=0;k<2;k++){
        cin>>b[k];
        if(minb>b[k]) minb=b[k];
        sumb=sumb+b[k];
    }
    cout<<suma+sumb-mina-minb<<endl;
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a[5],b[3],ans,dai,n;
	for (int i = 1; i <= 4; i++) {
		cin >> a[i];
	}
	for (int i = 1; i <= 2; i++) {
		cin >> b[i];
	}
	ans = 0;
	for (int i = 1; i <= 3; i++) {
		dai = 0;
		for (int z = 1; z <= 4; z++) {
			if (a[z] >= dai) {
				dai = a[z];
				n = z;
			}
		}
		a[n] = 0;
		ans = ans + dai;
	}
	ans = ans + max(b[1], b[2]);
	cout << ans << endl;
}

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

int main(){
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    int sum = 0, tmp1 = 0, tmp2 = 0;

    if (a > b){
        tmp1 = b;
    } else {
        tmp1 = a;
    }

    if (c > d){
        tmp2 = d;
    } else {
        tmp2 = c;
    }

    if (tmp1 > tmp2){
        tmp1 = tmp2;
    } else {
    }
    
    sum += a + b + c + d;
    sum -= tmp1;

    if(e > f){
        sum += e;
    } else {
        sum += f;
    }

    cout << sum << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d,e,f;
	cin>>a>>b>>c>>d>>e>>f;
	cout<<a+b+c+d-min({a,b,c,d})+max(e,f)<<endl;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
  int i,t[10],sum1=0,a;
  for(i=0;i<6;i++){
    cin >>t[i];
  }
  a=100;
  for(i=0;i<4;i++){
    if(a>t[i]){
      a=t[i];
    }
    sum1=sum1+t[i];
  }
  sum1=sum1-a;
  a=0;
  for(i=4;i<6;i++){
    if(a<t[i]){
      a=t[i];
    }
  }
  cout << sum1+a << endl;
  return(0);
}

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

using namespace std;

int main(){
	int a[4], b[2];
	int ans;

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

	sort(a, a + 4);
	sort(b, b + 2);

	ans = a[1] + a[2] + a[3] + b[1];

	cout << ans << endl;

	return 0;
}

C++: #include<stdio.h>
#include<iostream>
using namespace std;
int main(void)
{
	int a[500], b, c, d, e,f, g, i, j;
	for(i=0;i<6;i++){
		scanf("%d",&a[i]);
	}
	for(i=0;i<4;i++){
		for(j=1;j<4;j++){
			if(a[i]>a[j]){
				swap(a[i], a[j]);
			}}}
		if(a[4]>a[5]){
			swap(a[4], a[5]);
		}
		b=a[1]+a[2]+a[3]+a[5];
		printf("%d\n",b);
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;

int main()
{
	vector<int> science(4);
	vector<int> social(2);
	cin >> science[0] >> science[1] >> science[2] >> science[3] >> social[0] >> social[1];
	sort(science.rbegin(), science.rend());
	sort(social.rbegin(), social.rend());
	cout << science[0] + science[1] + science[3] + social[0] << endl;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int A,B,C,D,E,F,a,b,all=0;
	scanf("%d %d %d %d %d %d",&A,&B,&C,&D,&E,&F);
	all+=max(E,F)+A+C+D+B;
	a=min(A,B);
	b=min(C,D);
	all-=min(a,b);
	printf("%d\n",all);
	return 0;
}