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>
using namespace std;

int main() {
    int total = 0;
    int mini = 100;
    int tmp;

    for (int i = 0; i < 4; i++) {
        cin >> tmp;
        total += tmp;
        if (tmp < mini) mini = tmp;
    }
    total -= mini;

    mini = 100;
    for (int i = 0; i < 2; i++) {
        cin >> tmp;
        total += tmp;
        if (tmp < mini) mini = tmp;
    }
    total -= mini;

    cout << total << "\n";
    return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<functional>
using namespace std;
int main()
{
	int i,a[4],b,c,sum;
	for(i=0;i<4;i++){
		scanf("%d",&a[i]);
	}
	scanf("%d %d",&b,&c);
	sort(a,a+4,greater<int>());
	for(i=0;i<3;i++){
		sum+=a[i];
	}
	if(b>c){
		sum+=b;
	}
	else{
		sum+=c;
	}
	printf("%d\n",sum);
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define int long long
signed 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];
  int s=0;
  for(int i=0;i<4;i++) s+=a[i];
  sort(a,a+4);
  sort(b,b+2);
  s=s-a[0]+b[1];
  cout<<s<<endl;
  return 0;
}

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

#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

int x[6];

int main(){
	rep(i, 6){
		scanf("%d", &x[i]);
	}

	int s = 0;
	rep(i, 6){
		s += x[i];
	}
	printf("%d\n", s - *min_element(x, x + 4) - min(x[4], x[5]));
	return 0;
}

C++: #include <bits/stdc++.h>
#define birth <<
#define day endl
#define rollman 0
#define to ;return
using namespace std;
typedef int otaku;

otaku main(){
  otaku roll[4],man[2];
  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=0;
  for(otaku i=3;i>=1;i--) Happy+=roll[i];
  Happy+=man[1];
  cout << 
    Happy birth day to rollman;
}

C++: //Selecting Subjects
#include <iostream>

using namespace std;

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

    int s = 0, minv = 101;
    for(int i = 0; i < 4; i++) {
        s += Scores[i];
        minv = min(minv, Scores[i]);
    }
    s -= minv;
    minv = 101;
    for(int i = 4; i < 6; i++) {
        s += Scores[i];
        minv = min(minv, Scores[i]);
    }
    s -= minv;
    
    cout << s << endl;
}

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


int main() {
	int A, B, C, D, E, F;
	cin >> A >> B >> C >> D >> E >> F;

	int X = min(A,B);
	int XX = min(C, D);
	int XXX = min(X, XX);

	int XXXX = max(E, F);

	cout << (A + B + C + D) - XXX + XXXX << endl;

	return 0;
}

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


using namespace std ;


int main( void )
{
	int a ,b ,c ,d ;
	scanf( "%d %d %d %d" ,&a ,&b ,&c ,&d ) ;

	a = ( a + b + c + d ) - min( a ,min( b ,min( c ,d ) ) ) ;

	scanf( "%d %d" ,&b ,&c ) ;

	printf( "%d\n" ,a + max( b ,c ) ) ;


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

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<<endl;
}

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++: #include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>

void solve() {
    int ans = 0;

    std::vector<int> xs(4), ys(2);

    for (auto& x : xs) std::cin >> x;
    std::sort(xs.rbegin(), xs.rend());
    ans += std::accumulate(xs.begin(), --xs.end(), 0);

    for (auto& y : ys) std::cin >> y;
    std::sort(ys.rbegin(), ys.rend());
    ans += std::accumulate(ys.begin(), --ys.end(), 0);

    std::cout << ans << std::endl;
}

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

    solve();

    return 0;
}

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

int main() {
    int a[6],i;
    for(i = 0;i < 6;i++){
        cin >> a[i];
    }
    sort(a,a + 4);
    cout << (a[5] > a[4] ? a[5] : a[4]) + a[3] + a[2] + a[1] << endl;

}

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

int main(){
    int a,b,c,d,e,f,ob,oc,oe;
    cin>>a>>b>>c>>d>>e>>f;
    
    if(a>b){
        ob=b;
        b=a;
        a=ob;
    }
    if(b>c){
        oc=c;
        c=b;
        b=oc;
    }
    if(c>d){
        oc=c;
        c=d;
        d=oc;
    }
    if(a>b){
        ob=b;
        b=a;
        a=ob;
    }
    if(b>c){
        oc=c;
        c=b;
        b=oc;
    }
    if(c>d){
        oc=c;
        b=a;
        a=ob;
    }
    if(e>f){
        oe=e;
        e=f;
        f=oe;
    }
    if(a>b){
        ob=b;
        b=a;
        a=ob;
    }
    if(b>c){
        oc=c;
        c=b;
        b=oc;
    }
    if(c>d){
        oc=c;
        c=d;
        d=oc;
    }
    if(a>b){
        ob=b;
        b=a;
        a=ob;
    }
    if(b>c){
        oc=c;
        c=b;
        b=oc;
    }
    if(c>d){
        oc=c;
        b=a;
        a=ob;
    }
    if(e>f){
        oe=e;
        e=f;
        f=oe;
    }


    cout<<b+c+d+f<<endl;

}

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

using namespace std;

#define loop(index, begin, end, step) for (index = begin; i < end; i += step)
#define lp(index, end) loop(index, 0, end, 1)

int main()
{
	int i, sum = 0;
	array<int, 10> a, b;

	lp(i, 4)
		scanf("%d", &a[i]);
	lp(i, 2)
		scanf("%d", &b[i]);

	sort(a.rbegin(), a.rend());
	sum = max(b[0], b[1]);
	lp(i, 3)
	{
		sum += a[i];
	}

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

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

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 <iostream>
using namespace std;

int main () {
  int in;
  int ans = 0;

  int m = 101;
  for (int i = 0; i < 4; i++) {
    cin >> in;
    ans += in;
    m = min(in, m);
  }
  ans -= m;

  m = 101;
  for (int i = 0; i < 2; i++) {
    cin >> in;
    ans += in;
    m = min(in, m);
  }
  ans -= m;

  cout << ans << endl;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#define vi vector<int>
using namespace std;
int main(){vi v(4,0);vi v2(2,0);while(cin>>v[0]>>v[1]>>v[2]>>v[3]>>v2[0]>>v2[1]){sort(v.begin(),v.end());int ans=0;for(int i=1;i<=3;i++)ans+=v[4-i];cout<<ans+max(v2[0],v2[1])<<endl;}}

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

int s[7];
int main(){
    int sum=0;
    rep(i,6) cin>>s[i],sum+=s[i];
    sum-=*min_element(s,s+4)+min(s[4],s[5]);
    cout<<sum<<endl;
    return 0;
}