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: abcdef = [int(input()) for i in range(6)]
abcd = abcdef[0:4]
ef = abcdef[4:6]

#print(abcd)
#print(ef)

def quicksort(list):
    if len(list) < 2:
        return list
    else:
        pivot = list[0]
        #pivotよりも小さい要素を全て含んだ部分配列
        less = [i for i in list[1:] if i <= pivot]
        #pivotよりも大きい要素を含んだ部分配列
        greater = [i for i in list[1:] if i > pivot]
        return quicksort(greater) + [pivot] + quicksort(less)

s_abcd = quicksort(abcd)
s_ef = quicksort(ef)

#print(s_abcd)
#print(s_ef)

sum = 0
for i in s_abcd[0:3]:
    sum = sum + i

best = sum + s_ef[0]
print(best)

Python: lst1=[]
for i in range(4):
    a=int(input())
    lst1.append(a)
A=min(lst1)

lst2=[]
for j in range(2):
    b=int(input())
    lst2.append(b)
B=min(lst2)

X=sum(lst1)
Y=sum(lst2)
Z=X+Y-A-B
print(Z)

Python: A,B=[],[]
for _ in range(4):
    A.append(int(input()))
for _ in range(2):
    B.append(int(input()))
A.sort(reverse=True)
B.sort(reverse=True)
print(A[0]+A[1]+A[2]+B[0])

Python: a,b,c,d,e,f = map(int, input().split())
x = a + b + c + d + e + f
y = 100000
for i in (a,b,c,d):
 if y > i : y = i
z = 0
if e < f : z = f
else : z = e
print (x - y - z)

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

a=min(rika)
b=min(chiri)

kei=sum(rika)+sum(chiri)-a-b

print(kei)

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

Python: n=[int(input()) for i in range(6)]
x=sum(n[0:4])-min(n[0:4])
y=max(n[4],n[5])
print(x+y)

Python: a = []
b = []

for i in range(4):
    a.append(int(input()))
for i in range(2):
    b.append(int(input()))

print(sum(a)-min(a)+max(b))

Python: L=list()
M=list()
for i in range(4):
  L.append(int(input()))
for i in range(2):
  M.append(int(input()))
L.sort()
M.sort()
print(M[-1]+sum(L[-3:]))

Python: a=[int(input()) for i in range(6)]

s=sum(a[0:4])-min(a[0:4])+max(a[4],a[5])

print(s)

Python: lst=[]
for i in range(6):
    n=int(input())
    lst.append(n)
a=lst[:4]
a.remove(min(a))
A=sum(a)
b=lst[4:]
b.remove(min(b))
B=sum(b)
print(A+B)

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

Python: 
tmp = []

for i in range(4):  #物理，化学，生物，地学の 4 科目から 3 科目
    a = int(input())
    tmp.append(a)

list.sort(tmp,reverse=True)
sum1 = tmp[0]+tmp[1]+tmp[2]

b = int(input())
c = int(input())

print(sum1+max(b,c))

Python: four, two = [], []
for _ in range(4):
    four.append(int(input()))
for _ in range(2):
    two.append(int(input()))

print(sum(sorted(four)[1:] + sorted(two)[1:]))

Python: a=[int(input()) for _ in range(4)]
b=[int(input()) for _ in range(2)]
a.sort()
b.sort()
sum = a[1] + a[2] + a[3] + b[1]
print(sum)

Python: Si = []
So = []

for i in range(4) :
    p = int(input())
    Si.append(p)
    
for j in range(2) :
    p = int(input())
    So.append(p)
    
s = sum(Si) - min(Si) + sum(So) - min(So)

print(s)

Python: A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
F=int(input())
print(A+B+C+D+E+F-min(A,B,C,D)-min(E,F))

Python: a = [int(input()) for i in range(6)]
x = a[0:4]
y = a[4:6]
c = sum(a)-min(x)-min(y)    
print(c)

Python: scra = []
scrb = []

for i in range(4):
  scr = int(input())
  scra.append(scr)

for i in range(2):
  scr = int(input())
  scrb.append(scr)

scra.sort()
scrb.sort()

total = sum(scra[1:]) +  scrb[1]
print(total)

Python: list_a = []
list_b = []

for x in range(4) :
    list_a.append(int(input()))
list_a.sort(reverse = True)

for x in range(2) :
    list_b.append(int(input()))
list_b.sort(reverse = True)

print(sum(list_a[0:3]) + list_b[0])

Python: a=[];exec("a.append(int(input()));"*4);print(max(int(input()),int(input()))+sum(sorted(a)[1:]))

Python: lst=[]
lst2=[]
for i in range(4):
    a = int(input())
    lst.append(a)
lst.remove(min(lst))
for i in range(2):
    b = int(input())
    lst2.append(b)
lst2.remove(min(lst2))
lst.append(lst2[0])
print(sum(lst))

Python: list1=[]
list2=[]
for i in range(4):
    list1.append(int(input()))
list1.sort(reverse=True)
    
for i in range(2):
    list2.append(int(input()))
list2.sort(reverse=True)

print(sum(list1[0:3])+list2[0])

Python: list_a = []
list_b = []

for x in range(4) :
    list_a.append(int(input()))
list_a.sort(reverse = True)

for x in range(2) :
    list_b.append(int(input()))
list_b.sort(reverse = True)

print(sum(list_a[0:3]) + list_b[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: int_list = []
kei = 0
for num in range(4):
    inta = int(input())
    int_list.append(inta)
int_list.sort()
for num1 in range(1,4):
    kei += int_list[num1]
int_list = []
for num2 in range(2):
    inta = int(input())
    int_list.append(inta)
int_list.sort()
kei += int_list[1]
print(kei)

Python: A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
F = int(input())

X = [A, B, C, D]
X.sort()
t = X[1] + X[2] + X[3] + max(E, F)
print(t)

Python: a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
x = a + b + c + d + e + f
y = 100000
for i in (a,b,c,d):
    if y > i : y = i
z = 0
if e < f : z = e
else : z = f
print (x - y - z)

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: rika=[]
shakai=[]
for i in range(4):
    r=int(input())
    rika.append(r)
    
for j in range(2):
    s=int(input())
    shakai.append(s)
    
rika.sort(reverse=True)
shakai.sort(reverse=True)

print(sum(rika)-min(rika)+shakai[0])

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

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

print(sum(a)-min(a)+max(b))

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

Python: list_a = []
list_b = []

for x in range(4) :
    list_a.append(int(input()))
list_a.sort(reverse = True)

for x in range(2) :
    list_b.append(int(input()))
list_b.sort(reverse = True)

print(sum(list_a[0:3]) + list_b[0])

Python: a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())

e = max(e,f)
t = min(a,b)
t = min(c,t)
t = min(d,t)

print(a+b+c+d-t+e)

Python: list=[]
for i in range(4):
    a=int(input())
    list.append(a)
list.remove(min(list))

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

print(sum(list)+max(lst))

Python: a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())

min1 = 100
if min1 > a:    min1 = a
if min1 > b:    min1 = b
if min1 > c:    min1 = c
if min1 > d:    min1 = d

if e < f:   min2 = e
else:       min2 = f

print((a+b+c+d+e+f) - min1 - min2)

Python: a=[]
b=[]

for i in range(4):
  a.append(int(input()))
  a.sort(reverse=True)

for j in range(4,6):
  b.append(int(input()))
  b.sort(reverse=True)
  
print(sum(a[:3])+b[0])

Python: data = [int(input()) for z in range(6)]
data[:4]
a = min(data[:4])
b = sum(data[:4])

data[4:]
c = max(data[4:])

print(b - a + c)