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++: //============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include<algorithm>
#include<cstdlib>
using namespace std;
int A,B,C,D,E,F;
int X[10001],Y[10001];
int main() {
	cin>>A>>B>>C>>D>>E>>F;

	int S,T;
	S=A;
	T=E;
	if(S>B)S=B;
	if(S>C)S=C;
	if(S>D)S=D;
	if(T>F)T=F;
	int R=A+B+C+D+E+F;
	cout<<R-S-T<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
//#include<Rollman>
#define Otaku main
#define Elite cin
#define Rollman return 0
#define Happy_birthday_Rollman endl
#define My_Rollman_is cout

using namespace std;

int Otaku(){
  int result[4],result2[2],nearGPA4=0;//(GPA3.98)
  for(int i=0;i<4;i++) Elite>>result[i];
  for(int i=0;i<2;i++) Elite>>result2[i];
  sort(result,result+4);
  sort(result2,result2+2);
  for(int i=3;i>=1;i--) nearGPA4+=result[i];
    nearGPA4+=result2[1];
   
    My_Rollman_is<<nearGPA4;
    cout<<Happy_birthday_Rollman;
       
  Rollman;
}

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

int main() {
  int a[6];
  for(int i=0; i<6; i++) cin >> a[i];
  sort(a,a+4);
  sort(a+4,a+6,greater<int>());
  int ans=0;
  for(int i=1; i<5; i++) ans+=a[i];
  cout << ans << endl;
  return 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;
	cout << a + b + c + d - min(min(min(a, b), c), d) + max(e, f) << endl;
	cin >> c;
}

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 + 4, a + 6);
	cout << a[1] + a[2] + a[3] + a[5] << 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 score1[4];
    int score2[2];
    int sum = 0;

    for (int i = 0; i < 4; i++){
        cin >> score1[i];
    }
    for (int j = 0; j < 2; j++){
        cin >> score2[j];
    }

    sort (score1, score1 + 4);
    sort (score2, score2 + 2);

    for (int l = 3; l > 0; l--){
        sum += score1[l];
    }
    sum += score2[1];

    cout << sum << endl;

    return (0);
}

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

using namespace std;

int main(){
  vector<int> science;
  vector<int> society;

  for(int i = 0;i < 4;++i){
    int s;
    cin>>s;
    science.push_back(s);
  }
  sort(science.begin(),science.end());
  reverse(science.begin(),science.end());

  for(int i = 0;i < 2;++i){
    int s;
    cin>>s;
    society.push_back(s);
  }
  sort(society.begin(),society.end());
  reverse(society.begin(),society.end());

  int a = science.at(0) + science.at(1) + science.at(2);
  int b = society.at(0);

  int ans = a + b;

  cout<<ans<<endl;

  return 0;
}

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

struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef queue<int> qi;
typedef stack<int> si;
typedef deque<int> dqi;

#define reps(i, a, b) for (int i = a; i < b; ++i)
#define rep(i, n) reps(i, 0, n)
#define REPS(i, a, b) reps(i, a, b)
#define REP(i, n) rep(i, n)
#define deps(i, a, b) for (int i = a; i >= b; --i)
#define dep(i, n) deps(i, n, 0)
#define DEPS(i, a, b) deps(i, a, b)
#define DEP(i, n) dep(i, n)

#define pf push_front
#define pb push_back
#define mp make_pair
#define fst first
#define FST fst
#define sec second
#define SEC sec
#define sz(obj) ((int)(obj).size())
#define all(v) (v).begin(), (v).end()
#define ALL(v) all(v)

const int INF = 999999999;
const int MOD = 1e9 + 7;
const int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; std::cin >> x; return x;}
template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << endl;
}
template <typename T> void print(T x) { std::cout << x << '\n'; }

signed main()
{
  vi v(4);

  rep(i, 4) v[i] = in();
  sort(all(v));
  print(v[1] + v[2] + v[3] + max(in(), in()));

  return (0);
}

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

using namespace std;

/*-------------------------------*/
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (b) - 1; i >= (a); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define all(i) (i).begin(),(i).end()
#define rall(i) (i).begin(),(i).end(),greater<int>()
#define pb push_back
#define mp make_pair

typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef vector<long long> llv;
typedef vector<pint> vpint;

/*-------------------------------*/

int main(void)
{
  vi a, b;
  int x, ans = 0;
  rep(i, 4){
    cin >> x;
    a.pb(x);
  }
  rep(i, 2){
    cin >> x;
    b.pb(x);
  }

  sort(rall(a));
  sort(rall(b));
  rep(i, 3) ans += a[i];

  cout << ans + b[0] << endl;

  return (0);
}

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

int main(){
	int s[4];
	int m_max;
	int h[2];
	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<2;i++){
		cin>>h[i];
		h_max+=h[i];
	}
	h_max -= (min(h[0],h[1]));
	m_max += h_max;
	cout<<m_max<<endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()


int main() {
  int A, B, C, D, E, F;
  cin >> A >> B >> C >> D >> E >> F;
  int s = A + B + C + D;
  s -= min(min(A, B), min(C, D));
  cout << s + max(E, F) << "\n";
  return 0;
}

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

int maxof(const int a[]) {
	int i;
	int max = a[0];

	for (i = 1; i < 8; i++) {
		if (a[i] > max) max = a[i];
	}
	return max;
}

int main() {
	int a, b, c, d, e, f;
	int r1, r2, r3,r4,r5, r6, r7, r8;
	cin >> a >> b >> c >> d >> e >> f;
	r1 = a + b + c + e;
	r2 = a + b + c + f;
	r3 = a + b + d + e;
	r4 = a + b + d + f;
	r5 = a + c + d + e;
	r6 = a + c + d + f;
	r7 = b + c + d + e;
	r8 = b + c + d + f;
	int ar[] = { r1, r2, r3,r4,r5, r6, r7, r8 };
	cout << maxof(ar) << endl;
}

C++: #include <iostream>

using namespace std;

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