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

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

int main() {
  scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f);
  int min1 = 1000, min2 = 1000;
  min1 = min(min(a, b), min(c, d));
  min2 = min(e, f);
  printf("%d\n", a + b + c + d + e + f - min1 - min2);
}

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

#define llong long long
#define inf 999999999
#define mp make_pair
#define pb push_back
#define fn fill_n
typedef pair<int, int> P;
typedef pair<P, int> PP;
typedef pair<PP, int> PPP;
typedef struct data{
	int now;
	int cost;
}data;
int nh[4] = {1, 0, -1, 0};
int nw[4] = {0, 1, 0, -1};





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

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

int main(){
    int a[6];
    int sum=0;
    for(int i=0;i<6;i++){
        cin>>a[i];
        sum+=a[i];
    }
    
    int min=100;
    for(int j=0;j<4;j++){
        if(min>a[j])min=a[j];
    }
   
    sum=sum-min;
    
    if(a[4]>a[5])sum=sum-a[5];
    else sum=sum-a[4];
    
    cout<<sum<<endl;
}

C++: //16-1 ?§??????????
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
using namespace std;
int main(){
    int A,B,C,D,E,F;
    cin >> A >> B >> C >> D >> E >> F;

    int min = 101;
    if(A<min) min = A;
    if(B<min) min = B;
    if(C<min) min = C;
    if(D<min) min = D;
    int ans = A+B+C+D-min;

    min = 101;
    if(E<min) min = E;
    if(F<min) min = F;
    ans += E+F-min;

    cout << ans << endl;

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a[4],b[2];
  for(int i=0;i<4;i++){
    cin>>a[i];
  }
  sort(a,a+4);
  for(int i=0;i<2;i++){
    cin>>b[i];
  }
  sort(b,b+2);
  cout<<a[3]+a[2]+a[1]+b[1]<<endl;
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int a[4], b[2];
int main() {
	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<bits/stdc++.h>
using namespace std;

int main(){

  int sum=0;

  int in,in2;
  int min=100;

  for(int i=0; i<4; i++){
    cin >> in;
    sum+=in;
    if(min>in)
      min=in;
  }

  sum -= min;

  cin>>in>>in2;

  if(in<in2)
    sum += in2;

  else
    sum += in;

  cout << sum << endl;

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a, b, c, d, e, f;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    cin >> e;
    cin >> f;
    
    cout << a + b + c + d - min(a, min(b, min(c, d))) + max(e, f) << endl;
}

C++: #include<stdio.h>

int main(){
    int A;
    int B; 
    int C;
    int D;
    int E;
    int F;
    int ab;
    int cd;
    int abcd;
    int EF;
    int ABCD;
    int ABCDEF;
    scanf("%d",&A);
    scanf("%d",&B);
    scanf("%d",&C);
    scanf("%d",&D);

    scanf("%d",&E);
    scanf("%d",&F);
    ABCD=A+B+C+D;
    if(A>=B){
       ab=B;
    }
    if(B>=A){
       ab=A;
    }

    if(C>=D){
       cd=D;
    }
    if(D>=C){
       cd=C;
    }

    if(ab>=cd){
       abcd=cd;
      }
    if(cd>=ab){
       abcd=ab;
      }
    
    if(E<=F){
       EF=F;
    }
    if(F<=E){
       EF=E;
    } 

    ABCDEF=ABCD-abcd+EF;
     
    printf("%d",ABCDEF);

    return 0;

}

C++: #include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <random>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
#include <chrono>
#include <cstdlib>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
const double pi = acos(-1);
typedef pair<int, int> P;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EPS 1e-4
#define OUTPUT(i) (cout << (ll)i << endl)
#define ALL(a) ((a).begin(), (a).end())

bool operator<(const pair<ll, ll> &a, const pair<ll, ll> &b)
{

    if (a.first == b.first)
        return a.second < b.second;

    return a.first < b.first;
}

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

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

    //cout << fixed << setprecision(15);

    int sum = 0;
    int a1[4];
    for (int i = 0; i < 4; ++i)
        cin >> a1[i];
    sort(a1, a1 + 4);

    sum += a1[1] + a1[2] + a1[3];

    int a2[2];
    for (int i = 0; i < 2; ++i)
    {
        cin >> a2[i];
    }
    sum += max(a2[0], a2[1]);
    cout << sum << endl;
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main(void) {
  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<algorithm>
#include<iostream>
using namespace std;

int main(){
	int s[4];
	int m_max;
	int h[3];
	int h_max;
	for(int i = 0;i<4;i++){
		cin>>s[i];
		m_max += s[i];
	}
	m_max -= (min(s[0],min(s[1],min(s[2],s[3]))));
	for(int i = 0;i<3;i++){
		cin>>h[i];
		h_max+=h[i];
	}
	h_max -= (min(h[0],min(h[1],h[2])));
	m_max += h_max;
	cout<<m_max<<endl;
}

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

using namespace std;
 
int main(){
	
	int S[4] = {};
	int P[2] = {};
	
	while( cin >> S[0] ){
		
	for(int i=1;i<4;i++)
	cin >> S[i];
	
	for(int i=0;i<2;i++)
	cin >> P[i];
	
	sort(S, S+4);
	sort(P, P+2);
	
	int TotalScore = S[1] + S[2] + S[3] + P[1];
	cout << TotalScore << "\n";
}
  return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
  int a[4];
  int e,f;
  cin >> a[0] >> a[1] >> a[2] >> a[3] >> e >> f;
  sort(a,a+4);

  cout << a[3]+a[2]+a[1]+max(e,f)<< endl;
  return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL

int main() {
	int a[6];
	for (int i = 0; i < 6; i++)cin >> a[i];
	cout << accumulate(a, a + 6, 0) - *min_element(a, a + 4) - *min_element(a + 4, a + 6) << endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int a[6],i,j,k,x,y,z,goukei;
    x=101;
    y=101;
    goukei=0;
    for(i=1;i<=6;i++){
        cin>>a[i];
    }
    for(j=1;j<=4;j++){
        goukei=goukei+a[j];
        if(x>a[j]){
            swap(x,a[j]);
        }
    }
    goukei=goukei-x;
    for(k=5;k<=6;k++){
        if(y<a[k]){
            swap(y,a[k]);
        }
    }
    z=goukei+y;
    cout<<z<<endl;
    return 0;
}