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])
}

Python: A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
F = int(input())
X = []
X.append(A)
X.append(B)
X.append(C)
X.append(D)
X.remove(min(X))
Y = []
Y.append(E)
Y.append(F)
Y.remove(min(Y))
Z = X + Y
W = sum(Z)
print(W)

Python: #(44)科目選択
a=[]
for i in range(4):
     n=int(input())
     a.append(n)
a.sort(reverse=True)
b=[]
for j in range(2):
     m=int(input())
     b.append(m)
b.sort(reverse=True)
sum=0
for k in range(3):
     u=a[(k)]
     sum+=u
B=b[0]
print(sum+B)

Python: a=[]
for i in range(4):
    x=int(input())
    a.append(x)
a.sort()
a.pop(0)
b=[]
for j in range(2):
    y=int(input())
    b.append(y)
b.sort()
b.pop(0)
print(sum(a)+sum(b))

Python: lstr=[int(input()) for i in range(4)]
lsts=[int(input()) for j in range(2)]

mr=max(lstr)
mr2=sorted(lstr)[-2]
mr3=sorted(lstr)[-3]
ms=max(lsts)
print(mr+mr2+mr3+ms)

Python: alist = []
blist = []
for i in range(4):
    a = int(input())
    alist.append(a)
for i in range(2):
    b = int(input())
    blist.append(b)
alist.sort()
blist.sort()
print(alist[1]+alist[2]+alist[3]+blist[1])

Python: rikei = [int(input()) for i in range(4)]

for i in range(0, 4):
    for j in range(i + 1, 4):
        if rikei[i] < rikei[j]:
            tmp = rikei[i]
            rikei[i] = rikei[j]
            rikei[j] = tmp

bunkei = [int(input()) for i in range(2)]
if bunkei[0] < bunkei[1]:
    tmp = bunkei[0]
    bunkei[0] = bunkei[1]
    bunkei[1] = tmp

print(rikei[0] + rikei[1] + rikei[2] + bunkei[0])

Python: s = []
for i in range(4):
    s.append(int(input()))
l = []
for i in range(2):
    l.append(int(input()))
print(sum(s) - min(s) + max(l))

Python: a=[]
a=[int(input()) for _ in range(6)]
print(sum(a[0:4])-min(a[0:4])+max(a[4:6]))

Python: a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
print(sum([a,b,c,d,max(e,f)])-min([a,b,c,d]))

Python: x = []
y = []
for i in range(4):
    n = int(input())
    x.append(n)
    #x = sorted(x)
for i in range(2):
    n = int(input())
    y.append(n)
    #y = sorted(y)
print(sum(x)-min(x)+max(y))

Python: science, literature = [], []
for i in range(4):
    science.append(int(input()))
science = sorted(science, reverse=True)

for i in range(2):
    literature.append(int(input()))
literature = sorted(literature, reverse=True)

print(sum(science[:3]) + literature[0])

Python: list=[]
for i in range(6):
    n=int(input())
    list.append(n)

list1=list[0:4]
list1.remove(min(list1))


list2=list[4:6]
list2.remove(min(list2))


a=sum(list1)+sum(list2)
print(a)

Python: a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
print(a+b+c+d-min(a,b,c,d)+max(e,f))

Python: sum  = 0
min1 = 101
min2 = 101
for i in range(4):
    n = int(input())
    sum += n
    if n < min1:
        min1 = n
for i in range(2):
    n = int(input())
    sum += n
    if n < min2:
        min2 = n
print(sum-min1-min2)

Python: L = []
for i in range(4):
    L.append(int(input()))

M = []
for i in range(2):
    M.append(int(input()))

L.sort(reverse=True)
M.sort(reverse=True)

print(sum(L[0:3])+M[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;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
	vector<int> p(6);
	for(int i = 0;i < 6;i++){
		cin >> p[i];
	}
	sort(p.begin(),p.end()-2);
	int s = 0;
	for(int i = 3;i > 0;i--){
		s += p[i];
	}
	if(p[4] < p[5]){
		s += p[5];
	}
	else{s+= p[4];}
	cout << s << endl;
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int a,b,c,d,e,f;
  cin>>a>>b>>c>>d>>e>>f;
  vector<int>vec={a,b,c,d};
  sort(vec.begin(),vec.end());
  reverse(vec.begin(),vec.end());
  vector<int>vec2={e,f};
  sort(vec2.begin(),vec2.end());
  reverse(vec2.begin(),vec2.end());
  
  cout<<vec[0]+vec[1]+vec[2]+vec2[0]<<endl;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
	int a[5],b[3],k,s,sum=0;
	for(int i=0;i<4;i++) cin >> a[i];
	for(int i=0;i<2;i++) cin >> b[i];

	for(int i=0;i<3;i++){
		if(a[i]<a[i+1]){
			k=a[i];
			a[i]=a[i+1];
			a[i+1]=k;
		}
	}

	for(int i=0;i<2;i++){
		if(b[i]<b[i+1]){
		b[i]=b[i+1];
		}
	}
	
	for(int i=0;i<3;i++){
		sum+=a[i];
	}

	sum+=b[0];

	cout << sum << endl;
	return 0;
}

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

using namespace std;

int main(){
	int i, a[4], b[2], total = 0;
	for(i = 0; i < 4; i++) cin >> a[i];
	for(i = 0; i < 2; i++) cin >> b[i];
	sort(a, a + 4);
	for(i = 3; i >= 1; i--){
		total += a[i];
	}
	sort(b, b + 2);
	for(i = 1; i >= 1; i--){
		total += b[i];
	}
	cout << total << endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
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(min(A, B), min(C, D)) + E + F - min(E , F) << endl;
  return 0;
}

C++: #include "bits/stdc++.h"
#define rep(i,a,n) for(int i = (a);i < (n);i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

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

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

using namespace std;

#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;i++)
#define FORVEC(i, v) for(int i = 0;i < v.size();i++)

#define INF 1000000000
#define pb(a) push_back(a)
#define llong long long
#define vi vector<int>
#define P pair<int,int>
#define all(vec) (vec.begin()),(vec.end())

int main(){
	int a,b,c,d,e,f;
	cin>>a>>b>>c>>d>>e>>f;
	cout<<a+b+c+d+e+f-min({a,b,c,d})-min({e,f})<<"\n";
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a[10],i,m;
	m=0;
	for(i=0;i<6;i++){
		scanf("%d",&a[i]);
		m=m+a[i];
	}
	printf("%d\n",m);
	return 0;
}