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>

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 <bitset>
#include <tuple>
#include <string>
#include <array>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <cstdio>
#include <cmath>
#ifdef LOCAL
  #include <iostream>
#endif
using namespace std;

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

typedef long long ll;

#ifdef LOCAL
  #define debug_echo(e) cout << "L" << __LINE__ << ": " << e << "\n"
  #define debug_repr(e) cout << "L" << __LINE__ << ": " << #e << " -> " << e << "\n"
#else
  #define debug_echo(e)
  #define debug_repr(e)
#endif

#define defread(T, fmt) \
  inline T read_ ## T() { \
    T result; \
    scanf(fmt, &result); \
    return result; \
  }
defread(int, "%d")
defread(ll, "%lld")
defread(float, "%f")
defread(double, "%lf")

int gcd(int m, int n) {
  if ((0 == m) || (0 == n)) return 0;
  while (m != n) {
    if (m > n) m -= n;
    else       n -= m;
  }
  return m;
}
int lcm(int m, int n) {
  if ((0 == m) || (0 == n)) return 0;
  return (m / gcd(m, n)) * n;
}

int main() {
  vector<int> a(4);
  vector<int> b(2);
  a[0] = read_int();
  a[1] = read_int();
  a[2] = read_int();
  a[3] = read_int();
  b[0] = read_int();
  b[1] = read_int();

  sort(all(a));
  sort(all(b));

  printf("%d\n", a[1] + a[2] + a[3] + b[1]);
}

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

int main(){

	int answer;
	int a,b,c,d,e,f;

	cin >> a >> b >> c >> d >> e >> f;
	
	int X = min(min(min(a, b), c), d);
	int Y = min(e, f);

	cout << a+b+c+d+e+f -X -Y << endl;


	/*
	int datanum = 0;
	for(int dataset = 0; dataset < 1; dataset++){
		if(input == 0) break;


		answer[dataset] = sum;

		datanum++;
	}

	for(int dataset = 0; dataset < datanum; dataset++){
		cout << answer[dataset] << 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 <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+5,a+6,greater<int>());
  int ans=0;
  for(int i=1; i<5; i++) ans+=a[i];
  cout << ans << endl;
  return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> a,q;
    int b;
    for(int i=0;i<4;i++){
        cin >> b;
        a.push_back(b);
    }
    for(int i=0;i<2;i++){
        cin >> b;
        q.push_back(b);
    }
    sort(a.begin(),a.end(),greater<int>());
    sort(q.begin(),q.end(),greater<int>());
    int ans=0;
    for(int i=0;i<3;i++){
        ans+=a[i];
    }
    ans+=q[0];
    cout << ans << endl;

    return 0;
}

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

int main() {
    vector<int> r(4);
    vector<int> b(2);
    rep(i, 4) {
        cin >> r.at(i);
    }
    rep(i, 2) {
        cin >> b.at(i);
    }
    sort(r.rbegin(), r.rend());

    int ans = 0;
    rep(i, 3) {
        ans+= r.at(i);
    }
    ans += max(b.at(0), b.at(1));
    cout << ans << endl;
}

C++: #include <stdio.h>
#include <algorithm>

using namespace std;

int main()
{
	int sum = 0;
	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(rbegin(a), rend(a));
	sum = max(b[0], b[1]);
	for (int i = 0; i < 3; i++)
	{
		sum += a[i];
	}

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

C++: #include<iostream>
#include<string>
#include<set>
#include<utility>
#include<vector>
#include<map>
#include<algorithm>
#include<queue>
#include<stack>

using namespace std;

//科目選択

int main(){
	int a, b, c, d, e, f;
	cin >> a >> b >> c >> d >> e >> f;

	if(e < f) e = f;

	int sum = a + b + c + d;

	if(a>b) a = b;
	if(a>c) a = c;
	if(a>d) a = d;

	cout << sum - a + e << endl;

	return 0;
}

C++: #include<iostream>

using namespace std;

int a[4],b[2];

int main(){
    cin>>a[0]>>a[1]>>a[2]>>a[3]>>b[0]>>b[1];
    sort(a,a+4);sort(b,b+2);
    cout<<a[1]+a[2]+a[3]+b[1]<<endl;
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

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;
  return 0;
}

C++: #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "cmath"
#include "random"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

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

	vector<int>v(4);
	for (int i = 0; i < 4; i++) {
		cin >> v[i];
	}
	sort(v.begin(), v.end());
	N += v[1] + v[2] + v[3];
	cin >> v[0];
	cin >> v[1];
	N += max(v[0], v[1]);
	cout << N << endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
  int sum = 0;
  int data[6];
  for(int i = 0;i < 6;i++) {
    cin >> data[i];
    sum += 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 P[6];
  for(int i=0;i<6;i++){
    cin >> P[i];
  }
  sort(P,P+4);
  int sum = 0;
  for(int i=3;i>0;i--){
    sum += P[i];
  }
  sum += max(P[4],P[5]);
  cout << sum << endl;
}

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

using namespace std;

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

  for(int i=0;i<6;i++)
    {
      cin >> point;
      
      if(i<4)
	science.push_back(point);
      else
	society.push_back(point);

    }

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

  cout <<science[0]<<endl;
  

  cout << science[0]+science[1]+science[2]+society[0] << endl;

  return 0;
}

C++: #include<iostream>
#include<algorithm>
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);
    sort(b, b+2);
    cout << a[3]+a[2]+a[1]+b[1] << endl;
    return 0;
}