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: 
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: print(sum(sorted(int(input()) for _ in range(4))[1:])+max(int(input()) for _ in range(2)))

Python: score=[]
min=100
total=0

for i in range(4):
    score.append(int(input()))
    if min>score[i]:
        min = score[i]
    total+=score[i]
total-=min
min=100
for i in range(4,6):
    score.append(int(input()))
    if min>score[i]:
        min=score[i]
    total+=score[i]
total-=min
print(str(total))

Python: # AOJ 0619: Selecting Subjects
# Python3 2018.7.2 bal4u

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

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

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

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

s=min(a[0:4])
t=min(a[4:6])


a.remove(s)
a.remove(t)

print(sum(a))

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

sorted_score = sorted(score[:4])

sorted_score_2 = sorted(score[4:])

total = 0
for i in sorted_score[1:]:
    total += i
total += sorted_score_2[1]

print(total)

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

sum1 = 0
sum2 = 0

if A <= B and A <= C and A <= D:
    sum1 = B+C+D
elif B <= A and B <= C and B <= D:
    sum1 = A+C+D
elif C <= A and C <= B and C <= D:
    sum1 = A+B+D
else:
    sum1 = A+B+C

if E <= F:
    sum2 = F
else:
    sum2 = E
    
print(sum1 + sum2)

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

a.sort()
b.sort()

print(sum(a[1:])+b[1])

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 = [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):
    n = int(input())
    a.append(n)
for j in range (2):
    m = int(input())
    b.append(m)
a.sort()
b.sort()    
y=int(a[1]+a[2]+a[3]+b[1])
print(y)

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)

lst1=lst[0:4]
lst2=lst[4:6]
lst1.sort(reverse=True)
lst3=lst1[0:3]
a=sum(lst3)
b=max(lst2)

print(a+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 - min(a,b,c,d)
y = max(e,f)
print(x + y)

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

a.sort()
b.sort()

print(sum(a[1:])+b[1])

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

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())
A=[a,b,c,d]
B=[e,f]
x=sorted(A)
y=sorted(B)
print(x[3]+x[1]+x[2]+y[1])

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

Python: N=4
M=2
sum=0
I=[int(input()) for _ in range(N)]
I.sort()
sum=sum+I[3]+I[1]+I[2]
J=[int(input()) for _ in range(M)]
J.sort()
sum=sum+J[1]
print(sum)

Python: subjects = [int(input()) for _ in range(6)]
print(sum(sorted(subjects[:4])[-3:]) + sum(sorted(subjects[4:])[-1:]))

Python: import heapq

rika=[]
syakai=[]

for i in range(4):
    n=int(input())
    rika.append(n)
    
rika=heapq.nlargest(3,rika)

for j in range(2):
    n=int(input())
    syakai.append(n)
    
syakai=heapq.nlargest(1,syakai)

rika.extend(syakai)
print(sum(rika))

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]
print(a+b+c+d+e+f-min(x)-min(y))

Python: list1=[]

for i in range(6):
    n=int(input())
    list1.append(n)

list2=(list1[4:])  
list1=(list1[:4])

list1.sort()
del list1[0]
list2.sort()
del list2[0]

sum1=sum(list1)


sum2=sum(list2)
print(sum1+sum2)

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

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

Python: s1=[int(input()) for _ in range(4)]
s2=[int(input()) for _ in range(2)]
s1.sort(reverse=True)
s2.sort(reverse=True)
ans=s1[0]+s1[1]+s1[2]+s2[0]
print(ans)

Python: a=[]
b=[]
for i in range(4):
    s=int(input())
    a.append(s)
for j in range(2):
    t=int(input())
    b.append(t)
a=sorted(a)
b=sorted(b)
print(sum(a[1:4])+b[1])

Python: tensu=[None]*4
ten=[None]*2
for i in range(4):
    tensu[i]=input()
tensu=list(map(int,tensu))

for i in range(2):
    ten[i]=input()
ten=list(map(int,ten))

if ten[0]<ten[1]:
    b=0
    b=ten[0]
    ten[0]=ten[1]
    ten[1]=b

for i in range(4):
    if tensu[3]>tensu[i]:
        k=0
        k=tensu[i]
        tensu[i]=tensu[3]
        tensu[3]=k
    i+=1
    
s=0
i=0
for i in range(3):
    s+=tensu[i]
    i+=1

c=s+ten[0]

print(c)

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

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

print(sum(lst)+max(lst2))

Python: phy=int(input())
che=int(input())
bio=int(input())
geo=int(input())
rek=int(input())
tir=int(input())

rika=[phy,che,bio,geo]
rika.sort()
a=rika[1]+rika[2]+rika[3]

if rek>tir:
    b=rek
else:
    b=tir
print(a+b)

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

list2 = [int(input()) for i in range(2)]

list1_min = min(list1)

list2_min = min(list2)

print(sum(list1) + sum(list2) - list1_min - list2_min)

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

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

print(sum(n[0:4])-min(n[0:4]) + max(n[4], n[5]))

Python: list=[int(input()) for j in range(6)]

x=[list[0],list[1],list[2],list[3]]
y=sorted(x)
sum=0
for i in range(1,4):
    sum+=int(y[i])
    
if list[4]>list[5]:
    sum+=int(list[4])
else:
    sum+=int(list[5])
print(sum)

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)
s=sum(alist)-min(alist)+sum(blist)-min(blist)    
print(s)

Python: tmp_list1=[]
tmp_list2=[]
for i in range(4):
    num=int(input())
    tmp_list1.append(num)
    
for i in range(2):
    num=int(input())
    tmp_list2.append(num)
final_ans = sum(sorted(tmp_list1, reverse=True)[0:3])+max(tmp_list2)
print(final_ans)

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