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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int line[6];
    for(int i=0;i<6;++i){
        cin>>line[i];
    }
    sort(line,line+4);
    sort(line+4,line+6);
    cout<<line[1]+line[2]+line[3]+line[5]<<endl;
    return 0;
}

C++: //2015
#include<iostream>
#include<slgorithm>
#include<functional>
using namespace std;
int main(void){
	int i,ad[4]={0},e=0,f=0,sum=0;
	for(i=0;i<4;i++){
		cin>>ad[i];
	}
	cin>>e;
	cin>>f;
	sort(ad,ad+4,greater<int>());//降順,昇順＝＝sort(ad,ad+4);
	for(i=0;i<3;i++){
		sum+=ad[i];
	}
	if(e<f){
		sum+=f;
	}
	else{
		sum+=e;
	}
	cout<<sum<<endl;
	return 0;
}

C++: #include <iostream>
#include <deque>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
#include <limits.h>
using namespace std;
int n;
int ans=0;
typedef vector<int> vi;
int main()
{
  vi a(4,0);
  vi b(2,0);
  cin >> a[0] >> a[1] >> a[2] >> a[3];
  cin >> b[0] >> b[1];
  sort(a.begin(),a.end(),greater<int>());
  sort(b.begin(),b.end(),greater<int>());
  int ans=0;
  for(int i=0;i<3;i++)
    {
      ans+=a[i];
    }
  ans+=b[0];
  cout << ans << endl;
  return 0;
}

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

using namespace std;

int main() {
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;

    int ans = a + b + c + d - min(min(a, b), min(c, d)) + max(e, f);
    cout << ans << endl;
    return 0;
}

C++: #include<iostream>
#include <algorithm>
#include<math.h>
#include<stdio.h>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<functional>

using namespace std;
#define FOR(i,a) for(int i=0;i<a;i++)


int main(){
	int a[4];int b[2];
	FOR(i,4){cin>>a[i];}
	FOR(i,2){cin>>b[i];}
	sort(a,a+4,greater<int>());
	sort(b,b+2,greater<int>());
	cout<<a[0]+a[1]+b[0]<<endl;
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
int s[5];
int main()
{
	int i,j,a,b,q;
	for(i=1;i<=4;i++)cin>>s[i];
	cin>>a>>b;
	for(i=1;i<=4;i++)
	{
		for(j=i+1;j<=4;j++)
		{
			if(s[i]<s[j])
			{
				q=s[i];s[i]=s[j];s[j]=q;
			}
		}
	}
	if(a>b)cout<<s[1]+s[2]+s[3]+a;
	else cout<<s[1]+s[2]+s[3]+b;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a[6];
  for(int i=0; i<6; i++) cin >> a[i];
  sort(a,a+4);
  sort(a+4,a+6,greater<int>());
  int ans=0;
  for(int i=1; i<5; i++) ans+=a[i];
  cout << ans << endl;
  return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int e,f,x,y[4],z,i,j;
	scanf("%d %d %d %d %d %d",y[0],y[1],y[2],y[3],&e,&f);
	for(i=0;i<3;i++){
		for(j=i+1;j<4;j++){
			if(y[i]<y[j]){
				z=y[i];
				y[i]=y[j];
				y[j]=z;
			}
		}
	}
		x=y[0]+y[1]+y[2];
	if(e>=f){
		x=x+e;
		printf("%d\n",x);
	}
	else{
		x=x+f;
		printf("%d\n",x);
	}
	return 0;
}

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

using namespace std;

int main(){
  int A,B,C,D,E,F;
  int temp=0,temp_max=0;
  
  cin>>A>>B>>C>>D>>E>>F;

  temp=(A+B+C+D)-min({A,B,C,D})+max({E,F});

  cout<<temp<<endl;

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c[100]={0},d,e=0,f=0,g,h,i;
	for (a=0;a<4;a++)
	{
		cin>>b;
		c[b]=1;
	}
	for (a=99;a>0;a--)
	{
		if (c[b]==1&&e!=3)
		{
			f=f+b;
			e++;
		}
	cin>>d>>e;
	if (d>=e)
	{
		g=d+f;
	}
	else
	{
		g=e+f;
	}
	cout<<g<<endl;
	return 0;
}

C++: #include <iostream>
using namespace std;

int main(void){
  int A,B,C,D,E,F;
  cin>>A>>B>>C>>D>>E>>F;
  int score=A+B+C+D;
  score-=min(min(A,B),min(C,D));
  score+=max(E,F);
  cout<<score<<endl;
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main()
{
    int s;
    vector<int> v;

    while (cin >> s) v.push_back(s);
    sort(v.begin(), v.begin() + 4);
    reverse(v.begin(), v.begin() + 4);
    cout << v[0] + v[1] + v[2] + max(v[4], v[5]) << endl;

    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int A,B,C,D,E,F;
    cin>>A>>B>>C>>D>>E>>F;
    for(int i=0;i<30;i++){
        if(A<B){swap(A,B);}
        if(B<C){swap(B,C);}
        if(C<D){swap(C,D);}
        if(E<F){swap(E,F);} 
    }cout<<A+B+C+E<<endl;
}

C++: //2015
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main(void){
	int i,ad[4]={0},e=0,f=0,sum=0;
	for(i=0;i<4;i++){
		cin>>ad[i];
	}
	cin>>e;
	cin>>f;
	sort(ad,ad+4,greater<int>());//降順,昇順＝＝sort(ad,ad+4);
	for(i=0;i<3;i++){
		sum+=ad[i];
	}
	if(e<f){
		sum+=f;
	}
	else{
		sum+=e;
	}
	cout<<sum<<endl;
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	vector<int> vec(4); int his, geo, ans;
	for (int i = 0; i < 4; i++) cin >> vec[i];
	cin >> his >> geo;
	sort(vec.begin(), vec.end(), greater<int>());
	ans = vec[0] + vec[1] + vec[2] + (his > geo ? his : geo);
	cout << ans << endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
	int s=0;
int a=0,b=INT_MAX;
int c;
for(int d=0;d<4;d++){
	scanf("%d",&c);
	a+=c;
	b=min(b,c);
}
a-=b;
b=INT_MAX;
for(int d=0;d<2;d++){
	scanf("%d",&c);
	a+=c;
	b=min(b,c);
}
printf("%d\n",a-b);
}

C++: #include <stdio.h>
#include<math.h>
#include <algorithm>
using namespace std;

int main(){
	int subA[4],subB[2];

	for(int i=0; i < 4; i++)scanf("%d",&subA[i]);
	for(int i=0; i < 2; i++)scanf("%d",&subB[i]);

	for(int i = 1; i <= 3; i++){
		for(int k = 3; k >= i; k--){
			if(subA[k] > subA[k-1]){
				swap(subA[k],subA[k-1]);
			}
		}
	}
	if(subB[1] > subB[0])swap(subB[1],subB[0]);

	printf("%d\n",subA[0]+subA[1]+subA[2]+subB[0]);

    return 0;
}

C++: #include<stdio.h>
int main()
{
	int a[7], ruio=0, hideo=0,masatoy=0;
	for (int i = 1; i <= 6; i++){
		scanf("%d", &a[i]);
	}
	for (int i = 1; i <= 4; i++) {
		for (int j = 1; j <= 4; j++) {
			if (a[j] < a[j + 1]) {
				ruio=a[j];
				a[j] = a[j + 1];
				a[j + 1] = ruio;
			}
		}
	}
	if (a[5] < a[6]) {
		a[5] = a[6];
	}
	printf("%d\n", a[1] + a[2] + a[3] + a[5]);
	return 0;
}

C++: #include<algorithm>
#include<iostream>
#include<cstdio>
int main()
{
    int a[10];
    int m;
    for(int i=0;i<=5;i++){
        std::cin>>a[i];
    }
    std::sort(a,a+3);
    m=std::max(a[4],a[5]);
    std:: cout<<a[3]+a[2]+a[1]+m<<std::endl;
    return 0;
    
    
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  int a[4],b[2];
  int ans=0,i;
  for(i=0;i<4;i++)
    cin >> a[i];
  for(i=0;i<2;i++)
    cin >> b[i];
  sort(a,a+4);
  sort(b,b+2);
  for(i=3;i>0;i--)
    ans+=a[i];
  ans+=b[1];
  cout << ans << '\n';
  return 0;
}

C++: //============================================================================
// Name        : AOL.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
int a,b,c,d,e,f,g,s,aka;
cin>>a>>b>>c>>d>>e>>f;
    g=a+b+c+d;
    aka=a;
    if( a>b)aka=b;
    if( b>c)aka=c;
    if( c>d)aka=d;
    g=g-aka;
    s=e;
    if( e<f)s=f;
    cout<<g+s<<endl;
}