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 <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <deque>
#include <ctime>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define pb push_back
#define mp make_pair
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
#define println(X) cout<<X<<endl;
#define DBG(X) cout<<#X<<" : "<<X<<endl;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;
const double PI = acos(-1);

int main(){
	vi a(4), b(2);
	rep(i, 4) cin>>a[i];
	rep(i, 2) cin>>b[i];
	sort(rall(a));
	int sum = 0;
	rep(i, 3) sum += a[i];
	sum += max(b[0], b[1]);
	cout<<sum<<endl;
}

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

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

int main(){
  int P[6];
  for(int i=0;i<6;i++){
    cin >> P[i];
  }
  sort(P,P+6);
  int sum = 0;
  for(int i=5;i>=2;i--){
    sum += P[i];
  }
  cout << sum << endl;
}

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

void print_vec(vector<int> vec)
{
  cout << "[";
  for (int i = 0; i < vec.size(); i++)
  {
    cout << vec.at(i);
    if (i < vec.size() - 1)
    {
      cout << ", ";
    }
  }
  cout << "] size: " << vec.size() << endl;
}

int main()
{
  vector<int> sciences(4);
  vector<int> societies(2);

  rep(i, 4)
  {
    int score;
    cin >> score;
    sciences.at(i) = score;
  }
  rep(i, 2)
  {
    int score;
    cin >> score;
    societies.at(i) = score;
  }

  sort(all(sciences));
  reverse(all(sciences));
  sort(all(societies));
  reverse(all(societies));

  int science_score = 0;
  int society_score = societies.at(0);

  rep(i, 3)
  {
    science_score += sciences.at(i);
  }

  printf("%d\n", science_score + society_score);
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int ten[6],ans=0;
    for(int i=0;i<6;i++)cin>>ten[i];
    for(int i=0;i<3;i++){
        int kawa=0;
        for(int j=1;j<4;j++)if(ten[kawa]<ten[j])kawa=j;
        ans+=ten[kawa];
        ten[kawa]=-1;
    }
    ans+=max(ten[4],ten[5]);
    cout<<ans<<endl;
}

C++: #include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
	int a[4];
	r(i,4)cin>>a[i];
	sort(a,a+4);
	int s=0;
	r(i,4)if(i>0)s+=a[i];
	int q,w;
	cin>>q>>w;
	if(q<w)s+=w;
	else s+=q;
	cout<<s<<endl;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<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 - min(min(min(a, b), c), d) + max(e, f) << endl;
	return 0;
}

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

int main() {

	int a[6];
	int i;
	int ans = 0;

	for (i = 0; i < 4; ++i) scanf("%d",&a[i]);

	std::sort(a, a + 4);
	ans += a[3] + a[2] + a[1];

	scanf("%d%d", &a[4], &a[5]);
	a[4] >= a[5] ? ans += a[4] : ans += a[5];

	printf("%d\n", ans);
	return 0;
}

C++: #include <iostream>
#include<algorithm>
using namespace std;
int main()
{
    int a[4],e,f;
    
    cin>>a[0]>>a[1]>>a[2]>>a[3]>>e>>f;
    sort(a,a+4);
   
    
    cout<<a[3]+a[2]+a[1]+(max(e,f))<<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 a[4];
	int b[2];
	int i=0;
	int j=0;
	int s=0;
	int h=0;
	
	for(i=0;i<4;i++){        
		cin>>a[i];
	}
	for(i=0;i<2;i++){
		cin>>b[i];
	}
	for(i=0;i<4;i++){
		if(a[j]>a[i]){
			j=i;
		}
		s=s+a[i];
	}
	s=s-a[j];
	if(b[0]>b[1]){
		s=s+b[0];
	}else{
		s=s+b[1];
	}
	cout<<s<<endl;
}

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+3);
	sort(a+4, a+6);
	int total = a[1]+a[2]+a[3]+a[5];
	printf("%d\n", total);
	return 0;
}

C++: #include <iostream>

int main() {
	int a = 0, b = 0, c = 0, d = 0, in, temp = 0;
	for (int i = 0; i < 4; i++) {
		std::cin >> in;
		if (a <= in) {
			c = b;
			b = a;
			a = in;
		}
		else if (b <= in) {
			c = b;
			b = in;
		}
		else if (c <= in) {
			c = in;
		}
	}

	for (int i = 0; i < 2; i++) {
		std::cin >> in;
		if (in > temp) temp = in;
	}

	std::cout << a + b + c + temp << std::endl;

	return 0;
}

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

using namespace std;

int main(){
  int science[4];
  int society[2];
  int max_science=0;
  int max_society=0;
  int total=0;

  for(int i=0;i<4;++i)
    cin>>science[i];

  sort(begin(science),end(science),greater<int>());

  for(int i=0;i<3;++i)
    total+=science[i];

  for(int i=0;i<2;++i)
    cin>>society[i];

  total+=max(society[0],society[1]);

  cout<<total<<endl;
}

C++: #include <bits/stdc++.h>
#define r(i,n) for(i=0;i<n;i++)
using namespace std;
int main(){
	int a[6];
	r(i,6)cin>>a[i];
	sort(a,a+6);
	int s=0;
	r(i,6)if(i>1)s+=a[i];
	cout<<s<<endl;
}

C++: #include<stdio.h>
int main(){
  int a[4],b[2],i,j,temp;
  for(i=0;i<4;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<2;i++){
    scanf("%d",&b[i]);
  }
  for(i=0;i<4;i++){
    for(j=0;j<3-i;j++){
      if(a[j]<a[j+1]){
	temp=a[j];
	a[j]=a[j+1];
	a[j+1]=temp;
      }
    }
  }
  if(b[0]<b[1]){
    b[0]=b[1];
  }
  printf("%d\n",a[0]+a[1]+a[2]+b[0]);
}

C++: #include <bits/stdc++.h>
using namespace std;
int a[10];
int main()
{
    int n=6,i=0;
    while (n--) {
        cin>>a[i];
        i++;
    }
    cout<<max(a[4],a[5])+a[0]+a[1]+a[2]+a[3]-min(a[0],min(a[1],min(a[2],a[3])))<<endl;
}

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

int main(){
	int s[4];
	int m_max;
	int h[3];
	int h_max;
	for(int i = 0;i<4;i++){
		cin>>s[i];
		m_max += s[i];
	}
	m_max -= (min(s[0],min(s[1],min(s[2],s[3]))));
	for(int i = 0;i<3;i++){
		cin>>h[i];
		h_max+=h[i];
	}
	h_max -= (min(h[0],min(h[1],h[2])));
	m_max += h_max;
	cout<<m_max<<endl;
}

C++: #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;
}