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>
#include<vector>
#define vi vector<int>
using namespace std;
int main(){vi v(4);vi v2(2);while(cin>>v[0]>>v[1]>>v[2]>>v[3]>>v2[0]>>v2[1]){sort(v.begin(),v.end());int ans=0;for(int i=1;i<4;i++)ans+=v[4-i];cout<<ans+max(v2[0],v2[1])<<endl;}}

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

using namespace std;

void solve()
{
	vector<int> science(4);
	for (int i = 0; i < 4; ++i)
	{
		cin >> science[i];
	}
	vector<int> arts(2);
	for (int i = 0; i < 2; ++i)
	{
		cin >> arts[i];
	}
	sort(science.begin(), science.end());
	sort(arts.begin(), arts.end());
	int sum = 0;
	for (int i = 3; i >= 1; --i)
	{
		sum += science[i];
	}
	sum += arts[1];
	cout << sum << endl;
}

int main()
{
	solve();
	return(0);
}

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++: #include<stdio.h>
#include<iostream>
#include<algorithm>
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i++)
using namespace::std;

int n;

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

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

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

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

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;
cin>>a>>b>>c>>d>>e>>f;
    g=a+b+c;
    if( a,b,d>c)g=a+b+d;
    if( a,c,d>b)g=a+c+d;
    if( b,c,d>a)g=b+c+d;
    s=e;
    if( e<f)s=f;
    cout<<g+s<<endl;
}

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

int a, b;
int x[4],y[2];

int ans = 0;

int main() {

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

  for(int i = 0; i < 2; i++){
    cin >> b;
    y[i] = b;
  }

  sort(x, x+4);
  sort(y, y+2);
  reverse(x, x+4);
  reverse(y, y+2);

  for(int i = 0; i < 3; i++){
    ans += x[i];
  }

  ans += y[0];

  cout << ans << endl;
}

C++: #include <bits/stdc++.h>

using namespace std;

vector<int> SubjectsInfo;

int main() {
	int score;

	for (int i = 0; i < 6; ++i) {
		cin >> score;
		SubjectsInfo.push_back(score);
	}
	sort(SubjectsInfo.begin(), SubjectsInfo.begin() + 4);
	cout << SubjectsInfo[1] + SubjectsInfo[2] + SubjectsInfo[3] + max(SubjectsInfo[4], SubjectsInfo[5]) << endl;

	return 0;
}

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

int main() {
  vector<int> s1;
  vector<int> s2;

  int S1, S2;

  for(int i; i < 4; i++) {
    cin >> S1;
    s1.push_back(S1);
  }

  for(int i; i < 2; i++) {
    cin >> S2;
    s2.push_back(S2);
  }

  sort(s1.begin(), s1.end(), greater<int>());
  sort(s2.begin(), s2.end(), greater<int>());

  int sum	= 0;
  for(int i = 0; i < 3; i++) {
    sum += s1[i];
  }
  for(int i = 0; i < 2; i++) {
    sum += s2[i];
  }

  cout << sum << endl;

  return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
    int a, b, c, d, e, f;
    int min1, min2, sum;
    cin >> a >> b >> c >> d >> e >> f;
    min1=a;
    if(min1>=b){min1=b;}
    if(min1>=c){min1=c;}
    if(min1>=d){min1=d;}
    
    min2=e;
    if(e>=f){min2=f;}
    
    sum=a+b+c+d+e+f-min1-min2;
    
    
    cout << sum << endl;
    
    
    
    
    
    
    
    return 0;
}

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

using namespace std;


int main(void)
{
	int a, b, c, d, e, f;
	int sum;
	scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f);
	sum = a + b + c + d + e + f - (min(a, min(b, min(c, d))) + min(e, f));
	printf("%d\n", sum);


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

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

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repp(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;
typedef pair<int, int> pii;


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

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int a[6];
	for (int i = 0; i < 6; i++)
	{
		cin >> a[i];
	}
	sort(a, a + 4);
	sort(a + 5, a + 6);
	cout << a[1] + a[2] + a[3] + a[5] << endl;
	
	return 0;
}

C++: #include <iostream>
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(min(a,b),min(c,d))+max(e,f)<<endl;
}

C++: #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<cstdio>
#include<fstream>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)

#define mp make_pair
#define P pair<int,int>
#define ll __int64
int t[100];
int main(){
	rep(i,6)cin>>t[i];
	sort(t,t+4);
	sort(t+4,t+6);
	cout<<t[1]+t[2]+t[3]+t[5]<<endl;
	
	return 0;
}

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

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