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<cstdio>
#include<cmath>
#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[1]+a[2]+a[3]+b[1]<<endl;
    return 0;
}

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

int main() {
  vector<int> s1;
  vector<int> s2;

  int S1, S2;

  for(int i; i < 4; i++) {
    cin >> S1;
    s1.push_back(S1);
  }

  for(int i; i < 2; i++) {
    cin >> S2;
    s2.push_back(S2);
  }

  sort(s1.begin(), s1.end(), greater<int>);
  sort(s2.begin(), s2.end(), greater<int>);

  int sum	= 0;
  for(int i = 0; i < 3; i++) {
    sum += s1[i];
  }
  for(int i = 0; i < 2; i++) {
    sum += s2[i];
  }

  cout << sum << endl;

  return 0;
}

C++: #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
	int a[4],s[2],d,f,g,h,i,j;
	for(i=0;i<4;i++){
		scanf("%d",&a[i]);
		if(i>0&&a[i]>a[i-1]){
			d=a[i-1];
			a[i-1]=a[i];
			a[i]=d;
		}
	}
	for(i=0;i<2;i++){
		scanf("%d",&s[i]);
		if(i>0&&s[i-1]<s[i]){
			s[i-1]=s[i];

		}
	}
		printf("%d\n",a[0]+a[1]+a[2]+s[0]);
	return 0;
}

C++: #include <bits/stdc++.h> 
using namespace std; 
const int dx[]={1,0,-1,0,1,-1,-1,1}; 
const int dy[]={0,1,0,-1,1,1,-1,-1}; 
const int INF = 1e9; 
const long long LINF = 1e18; 
const double EPS = 1e-8; 
#define pb emplace_back 
#define mk make_pair 
#define fr first 
#define sc second 
#define ll long long 
#define reps(i,j,k) for(int i = (j); i < (k); ++i) 
#define rep(i,j) reps(i,0,j) 
#define all(a) (a).begin(),(a).end() 
#define MOD 1000000007 
typedef pair<int,int> Pii; 
typedef vector<int> vi; 
typedef pair<string, int> Psi; 
typedef pair<ll, ll> Pll;

int main(){
	int sum = 0;
	vi a(4);
	rep(i,4){
		cin >> a[i];
		sum += a[i];
	}
	sort(a.begin(),a.end());

	vi b(2);
	rep(i,2){
		cin >> b[i];
		sum += b[i];
	}
	sort(b.begin(),b.end());

	cout << sum - a[0] - b[0] << endl;

	return 0;
}

C++: #include <iostream>
#include <algorithm>
int main(){
    int a,b,c,d,e,f,x,y,z;
    std::cin>>a>>b>>c>>d>>e>>f;
    x=a+b+c+d+e+f;
    y=std::min({a,b,c,d});
    z=std::min({e,f});
    std::cout<<x-y-z<<std::endl;
    return 0;
}

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

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

int goukei(vector<int> v)
{
	int sum = 0;
	rep(i, v.size()) sum += v.at(i);
	return sum;
}
int main(void)
{
  vector<int> test(6);
	rep(i, 6) cin >> test.at(i);
	int min1 = 101;
	rep(i, 4) min1 = min(min1, test.at(i));
	int min2 = min(test.at(4), test.at(5));
	int sum = goukei(test)-min1-min2;
	cout << sum << endl;
	return 0;
}

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

int main(void){

	int A, B, C, D, E, F;
	cin >> A >> B >> C >> D >> E >> F;

	cout << A + B + C + D + E + F - min(A, min(B, min(C, D))) - min(E, F) << endl;

	return 0;
}

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

int main(){
  int a;
    while(cin >> a){
      vector<int> v1;
      vector<int> v2;
      int max=0;
      v1.push_back(a);
      for(int i=0; i<3; ++i){
	int tmp;
	cin >> tmp;
	v1.push_back(tmp);
      }
      
      for(int i=0; i<2; ++i){
	int tmp;
	cin >> tmp;
	v2.push_back(tmp);
      }
      
      sort(v1.begin(),v1.end(),greater<int>());
      sort(v2.begin(),v2.end(),greater<int>());

      for(int i=0; i<3; ++i){
	max += v1[i];
      }
      for(int i=0; i<1; ++i){
	max += v2[i];
      }

      cout << max << endl;
    }
  return 0;
}

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

int main(){
    
    vector<int> t1,t2;
    int input = 0;
    
    for(int i = 0;i < 6;i++){
        if(i < 4){
            cin >> input;
            t1.push_back(input);
        }else{
            cin >> input;
            t2.push_back(input);
        }
    }
    
    sort(t1.begin(), t1.end());
    sort(t2.begin(), t2.end());
    
    int result = t1[3] + t1[2] + t1[1] + t2[1];
    cout << result << endl;
    
    return 0;
}

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

using namespace std;

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

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define R cout<<
#define an max(a,n)<<endl
int r,o,ll,m,a,n;
int main(){
  cin>>r>>o>>ll>>m>>a>>n;
  sort(&r,&a);
  R+o+ll+m+an;
  return 0;
}

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

int main(){

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

	cin >> a >> b >> c >> d >> e >> f >> g;

	int  m,z;

	if( f<g ){
		z = g;
	}
	else{
		z = f;
	}

	m = a;

	if( a > b ){
		m = b;
	}
	if( m > c ){
		m = c;
	}
	if( m > d ){
		m = d;
	}

	cout << z+a+b+c+d-m << endl;

	return 0;
}

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

int main(){
    priority_queue<int>q1,q2;
    int a,b;
    for(int i=0;i<4;i++){
        cin>>a;
        q1.push(a);
    }
    for(int i=0;i<2;i++){
        cin>>a;
        q2.push(a);
    }
    for(int i=0;i<3;i++){
        b+=q1.top();
        q1.pop();
    }
    cout<<b+q2.top()<<endl;
}

C++: #include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;

int main()
{
	vector<int> science(4);
	vector<int> social(2);
	cin >> science[0] >> science[1] >> science[2] >> science[3] >> social[0] >> social[1];
	sort(science.rbegin(), science.rend());
	sort(social.rbegin(), social.rend());
	cout << science[0] + social[0] << endl;
}

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

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

int main() {
  int a, b, c, d, e, f;
  std::cin >> a >> b >> c >> d >> e >> f;
  std::cout << a + b + c + d - std::min({a, b, c, d}) + std::max(e, f) << std::endl; 
}

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