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 <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 <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 <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++: #include<bits/stdc++.h>
using namespace std;
int main(void)
{
	int a,b,s,i,x;
	s=100;
	x=0;
	for(i=0;i<4;i++){
		cin>>a;
		if(s>a) s=a;
		x=x+a;
	}
	x=x-s;
	s=100;
	for(i=0;i<2;i++){
		cin>>b;
		if(s>b) s=b;
		x=x+b;
	}
	x=x-s;
	cout<<x<<endl;
	return 0;
}

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

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
typedef vector<int>vint;
typedef pair<int,int>pint;

int get(int n){
    vint v(n);
    rep(i,n)cin>>v[i];
    sort(v.rbegin(),v.rend());
    return accumulate(v.begin(),v.begin()+n-1,0);
}

signed main(){
    int a=get(4);
    int b=get(2);
    cout<<a+b<<endl;
    return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a[4],b,c;
	cin>>a[0]>>a[1]>>a[2]>>a[3]>>b>>c;
	sort(a,a+4);
	if(b>c)swap(b,c);
	cout<<a[1]+a[2]+a[3]+c<<endl;
	return 0;
	}

C++: #include<iostream>
using namespace std;
int i, sumrika=0, sumsha=0, t, u, cnt=0;
int minrika=110, minsha=110;
int rika[5], sha[3];
int main(){
for(i=1; i<=4; i++){
   cin>>rika[i]; sumrika+=rika[i];
   if(rika[i]<minrika){minrika=rika[i];}
}
for(i=1; i<=2; i++){
    cin>>sha[i]; sumsha+=sha[i];
    if(sha[i]<minsha){minsha=sha[i];}
}
int disp = (sumrika-minrika)+(sumsha-minsha);
cout << disp << endl;
}

C++: #include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
int main(){
	int A, B, C, D, E, F;
	scanf("%d%d%d%d%d%d", &A, &B, &C, &D, &E, &F);
	printf("%d\n", A + B + C + D + E + F - min(min(A, B), min(C, D)) - min(E, F);
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// ---------------------------------------------------------------------------

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    vector<int> r(4);
    int sum = 0;
    for(int i=0; i<4; i++) cin >> r[i],sum += r[i];
    int a,b;
    cin >> a >> b;
    sort(r.begin(),r.end());
    cout << sum - r[0] + max(a,b) << endl;
    return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init))
#define mp(a,b) make_pair(a,b)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int inf = ((1<<30)-1)*2+1 ;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}
template<typename T,typename U>
ll FindErase(T &v,U tar){
  ll cnt = 0;
  for(auto it = v.begin(); it != v.end();){
    if(*it == tar){
      it = v.erase(it);
      ++cnt;
    }
    else{
      ++it;
    }
  }
  return cnt;
}

template<typename T>
bool SuffixErase(T &v,size_t suf){
  if(suf > v.size()) return false;
  for(auto it = v.begin(); it != v.end();){
    if(distance(v.begin(),it) == suf){
      v.erase(it);
      return true;
    }
    else{
      ++it;
    }
  }
  return false;
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<ll> a(4);
  ll b,c;
  rep(i,4){
    cin >> a[i];
  }
  cin >> b >> c;
  sort(all(a));
  cout << max(b,c) + a[1] + a[2] + a[3] << endl;

  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int a[6],i,j,x,y,z;
    x=101;
    for(i=1;i<=6;i++){
        cin>>a[i];
    }
    for(j=1;j<=4;j++){
        if(x>a[j]){
            swap(x,a[j]);
        }
    }
    if(a[5]>a[6]){
        y=a[5];
    }else{
        y=a[6];
    }
    z=x+y;
    cout<<z<<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>
using namespace std;
int main(){
	int a,b,c,d,e,f,s;
	cin>>a>>b>>c>>d>>e>>f;

	if(a<b){swap(a,b);}
	if(b<c){swap(c,b);}
	if(c<d){swap(c,d);}
	if(a<b){swap(a,b);}
	if(b<c){swap(c,b);}

	if(e<f){swap(e,f);}
	
	s=a+b+c+e;
	cout<<s<<endl;

	return 0;
}