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;

int main() {
    int sum = 0,
        x = 0,
        y = 0;
    
    for (int i = 0; i < 6; i++) {
        int num;
        cin >> num;
        if (i <= 3) {
            sum += num;
            if (!(i) || (num < x)) {
                x = num;
            }
        } else if (i == 4) {
            y = num;
        } else {
            if (num > y) y = num;
        }
    }
    
    cout << (sum - x) + y << endl;
}

C++: #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>

#define INF_LL 9000000000000000000
#define INF 2000000000

#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

	bool same(int x, int y){
		return find(x) == find(y);
	}
};

int main(void){
	int a[4];
	int b[2];
	int res = 0;
	REP(i, 4){
		cin >> a[i];
	}
	cin >> b[0] >> b[1];

	sort(a, a+4);
	sort(b, b+2);
	cout << a[0] + a[1] + b[0] << endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(void){
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(c,d))-min(e,f)<<endl;
return 0;
}

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int maxnum(int x,int y);
int selectbig(int num[],int m);
int main(){
    int mdata[4] = {0};
    int sdata[2] = {0};
    int ans = 0;
    for(int i = 0;i < 4;i++){
        cin >> mdata[i];
    }
    for(int i = 0;i < 2;i++){
        cin >> sdata[i];
    }
    for(int i = 1;i <= 3;i++){
        ans+=selectbig(mdata,i);

    }
    ans+=maxnum(sdata[0],sdata[1]);
    cout << ans << endl;
    return 0;
}

int maxnum(int x,int y){
    if(x >= y){
        return x;
    }
    else{
        return y;
    }
}

int selectbig(int num[4],int m){
    
    sort(num,num+4);
    return num[4-m];
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  vi a(4), b(2);
  rep(i, 4) cin >> a[i];
  rep(i, 2) cin >> b[i];
  sort(rall(a)), sort(rall(b));
  cout << a[0] + a[1] + a[2] + b[0] << endl;
}

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;

  cout << max(e, f) + max(a, max(b, max(c, d))) << endl;
}

C++: #include <iostream>
using namespace std;
int main(){
    int a[4],b[2],min=100,sum;
    for(int i=0;i<4;i++){
        cin>>a[i];
        if(min>a[i]){
            min=a[i];
        }
        sum+=a[i];
    }
    cin>>b[0]>>b[1];
    if(b[0]<b[1]){
        b[0]=b[1];
    }
    sum+=b[0]-min;
    cout<<sum;
    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];
  sort(a, a + 4, greater<int>());
  sort(b, b + 2, greater<int>());
  int ans = 0; 
  for(int i = 0; i < 3; i++) ans += a[i];
  cout << ans + b[0] << endl;
  return 0;
}

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

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

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

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

using namespace std;

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = long long;
using P = std::tuple<int,int>;

const int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0, 0, -1, 1, -1, 1, -1, 1};

int A[6];

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

    for(int i=0;i<6;++i){
        std::cin >> A[i];
    }

    int res = (A[0] + A[1] + A[2] + A[3]) - *min_element(A, A+4) + *max_element(&A[4], &A[4]+2);
    std::cout << res << std::endl;
}

C++: #include<iostream>

using namespace std;

int which_one(int grade[], int num1, int num2)
{
	int least = 0;

	for (int i = num1; num2>i; i++)
	{
		if (grade[num1]>grade[num1 + 1])
			least = grade[num1 + 1];
		else
			least = grade[num1];
	}

	return least;
}

int main(void)
{
	int grade[6];
	int score = 0;

	for (int i = 0; i<6; i++)
	{
		cin >> grade[i];
		score += grade[i];
	}

	score -= which_one(grade, 0, 3);
	score -= which_one(grade, 4, 5);

	cout << score << endl;

	return 0;
}

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

int main(){
    int a,b,c,d,e,f;
    cin >>a>>b>>c>>d>>e>>f;
    score[]={a,b,c,d};
    sort(score,score+4)
    score2[]={e,f};
    sort(score2,score2+2)
    cout <<score[1]+score[2]+score[3]+score2[1]<<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) << endl;
}