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 <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <limits>
typedef long long ll;
#define REP(i,n)   for(int i=0; i<(int)(n); ++i)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); ++i)

#define in cin
#define out cout
#define pb push_back
using namespace std;

int main(){
	int a[4], b[2], mi = 999, sum=0;
	REP(i, 4) {
		in >> a[i];
		sum += a[i];
		mi = min(mi, a[i]);
	}
	in >> b[0];
	in >> b[1];
	int bb = max(b[0], b[1]);
	sum -= mi;

	
	out << sum+bb << endl;
	return 0;

}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c[101]={0},d,e=0,f=0,g,h,i;
	for (a=0;a<4;a++)
	{
		cin>>b;
		c[b]=1;
	}
	for (a=100;a>0;a--)
	{
		if (c[a]==1&&e!=3)
		{
			f=f+a;
			e++;
		}
	}
	cin>>d>>e;
	if (d>=e)
	{
		g=d+f;
	}
	else if (d<=e)
	{
		g=e+f;
	}
	cout<<g<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
#define GPA 4
#define ROLLMAN endl

using namespace std;
typedef int OTAKU;

OTAKU main(){
  
  OTAKU roll[ GPA ], man[ GPA ];

  for(OTAKU i = 0; i < 4; i++)cin>>roll[i];
  for(OTAKU i = 0; i < 2; i++)cin>>man[i];
  
  sort(roll,roll+4);
  sort(man,man+2);
  
  OTAKU Happy_Birthday=0;
  
  for(OTAKU i = 3; i > 0; i--) Happy_Birthday += roll[i];
  Happy_Birthday += man[1];
  
  cout << Happy_Birthday << ROLLMAN;
  return GPA-4;
}

C++: include<iostream>
using namespace std;
int main()
{
int a,b,c,d,e,f;
cin>>a>>b>>c>>d>>e>>f;
if(a>b)
{if(b>c){sum1=a+b}
else{sum2=a+c}
}
if(b>a)
{if(a>c){sum1=b+a}
else{sum1=b+c}
}
if(c>a)
{if(a>b){sum1=c+a}
else{sum1=c+b}
}
if(e>f){sum2=e}
else{sum2=f}

cout<<sum1+sum2;


return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;

int main(){
	int a[4],e,f,sum=0,x=120;
	for(int i=0;i<4;i++){
	cin >> a[i];
	sum=sum+a[i];
	if(a[i]<x)x=a[i];
	}
	sum=sum-x;
	cin >> e;
	cin >> f;
	if(e>f){sum=sum+e;}
	else if(e<f){sum=sum+f;}
	else if(e==f){sum=sum+e;}
	cout << sum << endl;
	return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <math.h>
#include <complex>

using namespace std;

int main(){

    int a[10];

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

    int min1 = a[0];
    int answer = 0;
    int count=0;

    for(int i=0;i<4;i++){
        if(a[i]<min1) min1 = a[i];
    }
    
    for(int i=0;i<4;i++){
        if(a[i]!=min1){
        answer += a[i];
        count++;
        }
    }

    if(count!=3){
        for(int i=0;i<3-count;i++) answer += min1;
    }

    if(a[4]>a[5]) answer += a[4];
    else answer += a[5];

    cout<<answer<<endl;

    return 0;


}

C++: #include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main(){
	int sci[4],soc[2];
	int sum=0;
	for(int i=0;i<4;i++){
		cin>>sci[i];
		sort(sci,sci+i+1,greater<int>());
	}

	for(int i=0;i<3;i++){
		sum+=sci[i];
	}
	for(int i=0;i<2;i++){
		cin>>soc[i];
		sort(soc,soc+i+1,greater<int>());
	}
	for(int i=0;i<1;i++){
		sum+=soc[i];
	}
	cout<<sum<<endl;
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,e,f,g,h,i,j,x;
	scanf("%d %d %d %d %d %d",&a,&b,&c,&e,&f);
	if(a>b){
		a=g;
	}
	else if(a<b){
		b=g;
	}
	if(b>c){
		b=h;
	}
	else if(b<c){
		c=h;
	}
	if(c>d){
		c=i;
	}
	else if(c<d){
		d=i;
	}
	if(e>f){
		e=j;
	}
	else if(e<f){
		f=j;
	}
	x=g+h+i+j;
	printf("%d\n",x);
	return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed 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<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++: //q1.cpp

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << x << endl;


#define mod 1000000007 //1e9+7
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 10000


int main(){
    
    int t[6];
    int ans = 0;
    
    for(int i=0;i<6;i++){
        scanf("%d",&t[i]);
        ans += t[i];
    }
    
    printf("%d\n",ans-min(min(t[0],t[1]),min(t[2],t[3]))-min(t[4],t[5]));
    
    return 0;
}

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()

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

int n;
int coin[]={500,100,50,10,5,1};
int ans;

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

	cin>>n;
	n=1000-n;
	REP(i,6) {
		if(n>=coin[i]) {
			ans+=floor(1.*n/coin[i]);
			n%=coin[i];
		}
	}
	cout<<ans<<endl;

	return 0;
}

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

int main(){
    int a,b,c,d,e,f,m,n;
    cin >> a >> b >> c >> d >> e >> f;
    
    if(a<b && a<c && a<d) m=b+c+d;
    if(b<a && b<c && b<d) m=a+c+d;
    if(c<a && c<b && c<d) m=a+b+d;
    if(d<a && d<b && d<c) m=a+b+c;
    if(e<f){
        n=f;
    }else{
        n=e;
    }
    cout << m+n << endl;
}