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: import heapq
list=[]
a=[int(input()) for i in range(6)]
b=a[:4]
c=a[4:6]
print(sum(heapq.nlargest(3,b)+heapq.nlargest(1,c)))

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

Python: import math
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
F = int(input())
s = [A,B,C,D]
m = [E,F]
S=sorted(s, reverse=True)
M=sorted(m, reverse=True)
z = [S[0],S[1],S[2],M[0]]
print(math.floor(sum(z)))

Python: array = [int(input()) for i in range(4)]
R = int(input())
T = int(input())
array.sort()
count = 0
count += array[-1]
count += array[-2]
count += array[-3]
if R>T:
    count +=R
    print(count)
else:
    count +=T
    print(count)

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: lst = []

for i in range(6):
    r = int(input())
    lst.append(r)
    

for i in range(4):
    for j in range(3,i,-1):
        if lst[j] < lst[j-1]:
            lst[j],lst[j-1] = lst[j-1],lst[j]
    

R = lst[1]+lst[2]+lst[3]

if lst[4] > lst[5]:
    S = lst[4]
else:
    S = lst[5]

print(R+S)

Python: score= [int(input()) for _ in range(6)]
print(sum(sorted(score[:4], reverse=True)[:3])+max(score[4], score[5]))

Python: x=[]
rikei=0
bunkei=0
for i in range(6):
    n=int(input())
    x.append(n)

y=x[0:4]
y.remove(min(y))
for j in range(3):
    rikei+=y[j]
#print(rikei)
    
    
z=x[4:6]
z.remove(min(z))
for k in range(1):
    bunkei+=z[k]
#print(bunkei)
 
    
print(rikei+bunkei)

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

Python: x=[]
for i in range(4):
    a=int(input())
    x.append(a)
    
x.remove(min(x))
 
y=[]    
for j in range(2):
    a=int(input())
    y.append(a)
    
y.remove(min(y))

z=x+y

print(sum(z))

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: # -*- coding: utf-8 -*-
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()
ans = X[1] + X[2] + X[3] + max(E, F)
print(ans)

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

m=[a, b, c, d]
n=[e, f]

k=sorted(m, reverse=True)
l=sorted(n, reverse=True)

x=k[:3]
y=l[:1]

print(sum(x)+sum(y))

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

S=[]
S.append(A)
S.append(B)
S.append(C)
S.append(D)

S.remove(min(S))

T=[]
T.append(E)
T.append(F)

T.remove(min(T))

P=S+T

U=sum(P)
print(U)

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: lst=[]
lt=[]
for i in range (4):
    n=int(input())
    lst.append(n)
lst.sort()
lst.pop(0)

    
for i in range (2):
    m=int(input())
    lt.append(m)
lt.sort()
lt.pop(0)

    
summ = sum(lst)+sum(lt)
print(f'{summ:.3g}')

Python: # coding: utf-8
# Your code here!

a = []
a = [int(input()) for _ in range(6)]

print(sum(a[0:4])-min(a[0:4])+max(a[4:6]))

Python: a=[]
for i in range(4):
    n=int(input())
    a.append(n)
a.sort(reverse=True)
b=[]
for i in range(2):
    m=int(input())
    b.append(m)
b.sort(reverse=True)
sum=0
for k in range(3):
    sum+=a[k]
print(sum+b[0])

Python: A=[]
B=[]
for i in range(4):
    a=int(input())
    A.append(a)
AA=sorted(A)
del AA[0]

for i in range(2):
    b=int(input())
    B.append(b)
BB=sorted(B)
del BB[0]

print(sum(AA)+sum(BB))

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

Python: # coding: utf-8
# Your code here!

try:
   l1 = []
   l2 = []
   for i in range(4):
      l1.append(int(input()))
      l1.sort()
      l1.reverse()
      
   for i in range(2):
      l2.append(int(input()))
      l2.sort()
      l2.reverse()
      
   print(sum(l1[0:3]) + l2[0])

except EOFError:
   pass

Python: a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
x = (a,b,c,d)
y = (e,f)
z = min(x)
w = sum(x)
z = w-z
g = z+max(y)
print(g)

Python: print(sum(sorted([int(input()) for _ in range(4)])[1:]) + max(int(input()), int(input())))

Python: a=[0]*4
b=[0]*2

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

a.sort()
del a[0]

for i in range(2):
    b[i]=int(input())
    
b.sort()
del b[0]
    
print(sum(a)+sum(b))

Python: A=[int(input()) for i in range(4)]
B=[int(input()) for r in range(2)]

C=int(sum(A)-min(A))
D=int(max(B))
print(C+D)

Python: print(sum(sorted(int(input()) for _ in range(4))[1:])+max([int(input()) for _ in range(2)]))

Python: points_1 = []
points_2 = []
for _ in range(4):
    points_1.append(int(input()))

for _ in range(2):
    points_2.append(int(input()))

print(sum(sorted(points_1)[1:]) + max(points_2))

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: import sys

def main():
    score1 = []
    for i in range(4):
        score1.append(int(input()))
    score1.sort()
    score2 = []
    for i in range(2):
        score2.append(int(input()))
    score2.sort()

    print(sum(score1[1:]+score2[1:]))
    return 0

if __name__ == '__main__':
    sys.exit(main())

Python: sub = []

for i in range(4):  
    a = int(input())
    sub.append(a)

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

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

print(sum1+max(b,c))

Python: # coding: utf-8
# Your code here!
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
F=int(input())

A,B,C,D=sorted([A,B,C,D])
E,F=sorted([E,F])

print(sum((B,C,D,F)))

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 = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
F = int(input())

print(sum(sorted([A, B, C, D])[:3]) + max(E, F))

Python: A=[int(input()) for i in range(4)]
B=[int(input()) for i in range(2)]
A.sort()
print(sum(A[1:4])+max(B))

Python: list=[int(input()) for i in range(4)]
list.sort()
list.pop(0)
s=[int(input()) for i in range(2)]
s.sort()
s.pop(0)
t=list+s
print(sum(t))

Python: num1=[]
num2=[]
for i in range(4):
    x=int(input())
    num1.append(x)
    
for i in range(2):
    y=int(input())
    num2.append(y)   
    
num1.sort()
num2.sort()

a=num1[1]
b=num1[2]
c=num1[3]
d=num2[1]
    

date=int(a+b+c+d)


print(date)

Python: flist = []
slist = []
for i in range(4):
    flist.append(int(input()))
for i in range(2):
    slist.append(int(input()))
    
mf = min(flist)
ms = min(slist)
flist.remove(mf)
slist.remove(ms)
print(sum(flist) + sum(slist))