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: min_1=100; min_2=100
sum_1=0; sum_2=0

for i in range(4):
    a=int(input())
    sum_1+=a
    if a<min_1:
        min_1=a

sum_1=sum_1-min_1
    
for j in range(2):
    b=int(input())
    sum_2+=b
    if b<min_2:
        min_2=b
    
sum_2=sum_2-min_2
    
print(sum_1+sum_2)

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], reverse=True)[:3]) + max(E, F))

Python: i=0
x=[0,0,0,0,0,0]
k=0
while i<6 :
    x[i]=int(input())
    i=1+i
while k<3 :
    if x[k]<x[k+1] : 
        ex=x[k]
        x[k]=x[k+1]
        x[k+1]=ex
    k=k+1
if int(x[4])<int(x[5]) : ave=x[0]+x[1]+x[2]+x[5]
else : ave=x[0]+x[1]+x[2]+x[4]
print(ave)

Python: y=[]
z=[]
for i in range(1,5):
    x=int(input())
    y.append(x)
y.remove(min(y))

for i in range(1,3):
    x=int(input())
    z.append(x)
z.remove(min(z))

print(int(y[0]+y[1]+y[2]+z[0]))

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

a.pop(a.index(min(a)))
print(int(sum(a) + max(b)))

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

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: 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: 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: 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: a=0
sum=0
list=[]
for i in range(0,6):
    n=int(input())
    list.append(n)
    
for i in range(0,3):
    if list[i]<list[i+1]:list[i],list[i+1]=list[i+1],list[i]
    sum=sum+list[i]

if list[4]<list[5]:sum=sum+list[5]
else:sum=sum+list[4]
print(sum)

Python: list1=[]
list2=[]
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
list1.append(a)
list1.append(b)
list1.append(c)
list1.append(d)
list1.sort()
list1.reverse()
list2.append(e)
list2.append(f)
list2.sort()
list2.reverse()
print(list1[0]+list1[1]+list1[2]++list2[0])

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: a,c=[],0
for i in range(4):
    a.append(int(input()))
a=sorted(a)
a.pop(0)
for j in range(2):
    b=int(input())
    if b>c:
        c=b
print(sum(a)+c)

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

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

list1=[a,b,c,d]
list2=[e,f]

list1.sort()
list2.sort()

print(list1[1]+list1[2]+list1[3]+list2[1])

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

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

a=x[0:4]
b=sorted(a)
del b[0]

c=x[4:]
d=sorted(c)
del d[0]

y=b+d
print(sum(y))

Python: A=[]
B=[]
for i in range(4):
    s1=int(input())
    A.append(s1)
for j in range(2):
    s2=int(input())
    B.append(s2)
C=sorted(A)
D=sorted(B)
C.pop(0)
D.pop(0)
sm1=sum(C)
sm2=sum(D)
print(sm1+sm2)

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

society = []
for _ in range(2):
    score = int(input())
    society.append(score)

science.sort()
society.sort()

total = sum(science[1:]) + society[1]
print(total)

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

A.sort(reverse=True)
B.sort(reverse=True)
ans = sum(A[:3]) + B[0]
print(ans)

Python: x1=[]
y1=[]
for i in range(4):
    A=int(input())
    x1.append(A)
x=sorted(x1,reverse=True)
for j in range(2):
    E=int(input())
    y1.append(E)
y=sorted(y1,reverse=True)
sum=x[0]+x[1]+x[2]+y[0]
print(sum)

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

Python: a=[]
b=[]

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

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: 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: 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: 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: lis_1=[]
lis_2=[]
for i in range(4):
    a=int(input())
    lis_1.append(a)
lis_1.sort()
for i in range(4,6):
    a=int(input())
    lis_2.append(a)
lis_2.sort()
x=lis_1[-1]
y=lis_1[-2]
z=lis_1[-3]
s=lis_2[-1]
print(x+y+z+s)

Python: q = [int(input()) for i in range(4)]
w = [int(input()) for i in range(2)]

q.pop(q.index(min(q)))
print(int(sum(q) + max(w)))

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

for j in range(4,6):
  b.append(int(input()))
  
print(sum(a[1:4])+max(b))

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

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: r = []
s = []
t = 0
for i in range(1,7):
    if i <= 4:
        a = int(input())
        r.append(a)
    else:
        b = int(input())
        s.append(b)
l = min(r)
L = min(s)
r.remove(l)
s.remove(L)
for j in range(3):
    t += r[j]
t += s[0]
print(t)

Python: rika=[]
for i in range(4):
    rika.append(int(input()))
a=min(rika)
rika.remove(a)
sum1=0
for i in range(3):
    sum1+=rika[i]
sya=[]
for i in range(2):
    sya.append(int(input()))
b=max(sya)
print(sum1+b)

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

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)