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

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

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

using namespace std;

int main()
{
    int S[6];
    for (int &s: S)
        cin>>s;
    cout<<accumulate(S,S+6,0)-*min_element(S,S+4)-*min_element(S+4,S+6)<<endl;
}

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

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

C++: //============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <algorithm>
using namespace std;
typedef struct pair<int,int> P;
int A,B,C,D,E,F;
int main() {
	cin>>A>>B>>C>>D>>E>>F;

	int M=A;
	if(B<M)M=B;
	if(C<M)M=C;
	if(D<M)M=D;
	int R=A+B+C+D-M;
	int L=0;
	if(E<F){
		L=F;
	}else{
		L=E;
	}

	cout<<R+L<<endl;
	return 0;
}

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[3]+a[1]]+b[1]<<endl;
        return 0;
}

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

int main() {
	int A, B, C, D, E, F;
	cin >> A >> B >> C >> D >> E >> F;
	cout << max(E, F) + max({ A + B + C, A + B + D, A + C + D, B + C + D }) << endl;
}

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

C++: //============================================================================
// Name        : AOL.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
int a,b,c,d,e,f,g,s,aka;
cin>>a>>b>>c>>d>>e>>f;
    g=a+b+c+d;
    aka=a;
    if( a>b)aka=b;
    if( aka>c)aka=c;
    if( aka>d)aka=d;

    g=g-aka;
    s=e;
    if( e<f)s=f;
    cout<<g+s<<endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    int a;
    std::deque<int> ri;
    std::deque<int> sya;
    for (int i=0;i<4;i++) {
        cin>>a;
        ri.emplace_back(a);
    }
    for (int k=0;k<2;k++) {
        cin>>a;
        sya.emplace_back(a);
    }
    sort(ri.begin(),ri.end(),greater<int>());
    sort(sya.begin(),sya.end(),greater<int>());
    int score=0;
    for (int l=0;l<3;l++) {
        score+=ri[l];
    }
    for (int m=0;m<1;m++) {
        score+=sya[m];
    }
    cout<<score<<endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
  int sum;
  int data[6];
  for(int i = 0;i < 6;i++)cin >> data[i];
  cout << sum - *min_element(data,data + 4) - *min_element(data + 4,data + 6) << endl;
  return 0;
}

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

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) << "\n";
}

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

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> p1(4), p2(2);
  int sum = 0;
  for (int i = 0; i < 4; i++) {
    cin >> p1[i];
    sum += p1[i];
  }
  for (int i = 0; i < 2; i++) {
    cin >> p2[i];
    sum += p2[i];
  }
  sort(p1.begin(), p1.end());
  sum -= (p1[0] + min(p2[0], p2[1]));
  cout << sum << "\n";
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int n,m,i,j,g,t = 0;
    int a[8];

    for(i = 0; i < 6;i++) {
        cin >> a[i];
        t += a[i];
    }
    m = a[0];
    for(i = 1; i < 4; i++) {
        m = min(m , a[i]);
    }
    t -= m + min(a[4], a[5]);
    cout << t << endl;
    return 0;
}

C++: #include<stdio.h>

int main(){
    int A;
    int B; 
    int C;
    int D;
    int E;
    int F;
    int ab;
    int cd;
    int abcd;
    int EF;
    int ABCD;
    int ABCDEF;
    scanf("%d",&A);
    scanf("%d",&B);
    scanf("%d",&C);
    scanf("%d",&D);

    scanf("%d",&E);
    scanf("%d",&F);
    ABCD=A+B+C+D;
    if(A>=B){
       ab=B;
    }
    if(B>=A){
       ab=A;
    }

    if(C>=D){
       cd=D;
    }
    if(D>=C){
       cd=C;
    }

    if(ab>=cd){
       abcd=cd;
      }
    if(cd>=ab){
       abcd=ab;
      }
    
    if(E<=F){
       EF=F;
    }
    if(F<=E){
       EF=E;
    } 

    ABCDEF=ABCD-abcd+EF;
     
    printf("%d\n",ABCDEF);

    return 0;

}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int A,B,C,D,E,F,a,b,all=0;
	cin>>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);
	cout<<all<<endl;
	return 0;
}
//5:29,047クリア

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

using namespace std;

int main(){
	int a[6];
	for (int i = 0; i < 6; i++){
		scanf("%d", &a[i]);
	}
	sort(a, a+4);
	
	int total = a[1]+a[2]+a[3]+max(a[4], a[5]);
	printf("%d\n", total);
	return 0;
}