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<bits/stdc++.h>
#define GPA 4
#define ROLLMAN endl
using namespace std;
typedef int OTAKU;

OTAKU main(){
  
  OTAKU roll[ GPA ], man[ GPA ];

  for(OTAKU i = 0; i < 4; i++)cin>>roll[i];
  for(OTAKU i = 0; i < 2; i++)cin>>man[i];
  
  sort(roll,roll+4);
  sort(man,man+2);
  
  OTAKU Happy_Birthday=0;
  
  for(OTAKU i = 3; i > 0; i--) Happy_Birthday += roll[i];
  Happy_Birthday += man[1];
  
  cout << Happy_Birthday << ROLLMAN;
  
  return GPA-0.02;
}

C++: // 2018/12/26 Tazoe

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	int A, B, C, D, E, F;
	cin >> A;
	cin >> B;
	cin >> C;
	cin >> D;
	cin >> E;
	cin >> F;

	cout << A+B+C+D+E+F-min(A, min(B, min(C, D)))-min(E, F) << endl;

	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cctype>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include <cstdio>
#include <numeric>

int main() {

	/*int N, M, a[100], b[100][100];
	

	std::cin >> N >> M;

	for (int i = 0;i < M;i++) {

		std::cin >> a[i];
	}
	for (int i = 0;i < M;i++) {
		for (int j = 0;j < N;j++) {
		std::cin >> b[i][j];
		int ap(100);
		ap = 0;
		if (a[i] = b[i][j]) {
			ap += 1;

		}
		else {

		}
		}
		

	}
	
	
	*/

	int a, b, c, d, e, f;


	std::cin >> a >> b >> c >> d >> e >> f;

	int N =  std::min({ a, b, c, d });

	int n = a + b + c + d - N;
	
	int M = std::max(e, f);

	std::cout << n + M << std::endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
	int a[6];
	r(i,6)cin>>a[i];
	sort(a,a+6);
	int s=0;
	r(i,6)if(i>1)s+=a[i];
	cout<<s<<endl;
}

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

int main(){
	int m_min = 100;
	int m_max = 0;
	int h_min = 100;
	int h_max = 0;
	for(int i = 0;i<4;i++){
		int s;
		cin>>s;
		if(m_min >s){
			m_min = s;
		}
		m_max += s;
	}
	m_max -= m_min;
	for(int i = 0;i<2;i++){
		int h;
		cin>>h;
		if(h_min >h){
			h_min = h;
		}
		h_max += h;
	}
	h_max -= h_min;
	m_max += h_max;
	cout<<m_max<<endl;
	return 0;
}

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<bits/stdc++.h>

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)

using namespace std;

int main() {
  int score[6];
  rep(i,6) cin >> score[i];
  sort(score,score+4,greater<int>());
  sort(score+4,score+6,greater<int>());
  cout << score[0] + score[1] + score[2] + score[4] << endl;
  return 0;
}

C++: #include <stdio.h>

void sort(int *ary,int size){
  int tmp;
  for (int i = 0; i < size; i++) {
    for (int j = size - 1; j > i; j--) {
     if (ary[j] > ary[j - 1]) {
        tmp =  ary[j];
        ary[j] = ary[j - 1];
        ary[j - 1] = tmp;
      }
    }
  }
}

int main(){
  int i1[4] = {};
  int i2[2] = {};

  for(int i = 0; i < 4; i++) scanf("%d",&i1[i]);
  sort(i1,sizeof(i1) / sizeof(int));

  for(int i = 0; i < 2; i++) scanf("%d",&i2[i]);
  sort(i2,sizeof(i2) / sizeof(int));

  for(int i = 1; i < 3; i++) i1[0] += i1[i];

  printf("%d\n",i1[0]+i2[0]); 
}

C++: #include<bits/stdc++.h>
#define GPA 4
#define ROLLMAN endl

using namespace std;
typedef int OTAKU;

OTAKU main(){
  
  OTAKU roll[ GPA ], man[ GPA ];

  for(OTAKU i = 0; i < 4; i++)cin>>roll[i];
  for(OTAKU i = 0; i < 2; i++)cin>>man[i];
  
  sort(roll,roll+4);
  sort(man,man+2);
  
  OTAKU Happy_Birthday=0;
  
  for(OTAKU i = 3; i > 0; i--) Happy_Birthday += roll[i];
  Happy_Birthday += man[1];
  
  cout << Happy_Birthday << ROLLMAN;
  return GPA;
}

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;
cin>>a>>b>>c>>d>>e>>f;
    g=a+b+c;
    if( a,b,d>c)g=a+b+d;
    if( a,c,d>b)g=a+c+d;
    if( b,c,d>a)g=b+c+d;
    s=e;
    if( e<f)s=f;
    cout<<g+s<<endl;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,e,f,m1,x1,x2,x3,max,min,ans;
	scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
	if(a<=b){
		x1=a;
	}
	else if(b<=a){
		x1=b;
	}
	if(x1<=c){
		x2=x1;
	}
	else if(c<=x1){
		x2=c;
	}
	if(x2<=d){
		x3=x2;
	}
	else if(d<=x2){
		x3=d;
	}
	if(e<=f){
		m1=e;
	}
	else if(f<=e){
		m1=f;
	}
	max=a+b+c+d+e+f;
	min=m1+x3;
	ans=max-min;
	printf("%d\n",ans);
	return 0;
}

C++: #include<stdio.h>
#include<string.h>
int main(){
	int r=0,a[4],b[2],i,s=100,nf;
	scanf("%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1]);
	for(i=0;i<4;i++){
		if(s>=a[i]){
			s=a[i];
			nf=i;
		}
	}
	for(i=0;i<4;i++){
		if(i!=nf){
			r+=a[i];
		}
	}
	if(b[0]>b[1]){
		r+=b[0];
	}else{
		r+=b[1];
	}

	printf("%d\n",r);
	return 0;
}

C++: #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
 
//const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
 
int main()
{
	vector<int> a(4);
	REP(i, 4) cin >> a[i];

	vector<int> b(2);
	REP(i, 2) cin >> b[i];

	sort(ALL(a), greater<int>());
	sort(ALL(b), greater<int>());

	int sum = 0;

	REP(i, 3) sum += a[i];
	sum += b[0];

	cout << sum << endl;

}

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

int main(){
	int A, B, C, D, E, F;
	std::cin >> A >> B >> C >> D >> E >> F;
	int K1 = A + B + C + D - std::min({ A,B,C,D });
	int K2 = E + F - std::min({ E,F });
	std::cout << K1 + K2 << std::endl;
	return 0;
}

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

int main(){

	int a,b,c,d,e,f;

	cin >> a >> b >> c >> d >> e >> f;

	int  m,z;

	if( e<f ){
		z = f;
	}
	else{
		z = e;
	}

	m = a;

	if( a > b ){
		m = b;
	}
	if( m > c ){
		m = c;
	}
	if( m > d ){
		m = d;
	}

	cout << z+a+b+c+d-m << endl;

	return 0;
}

C++: #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <utility>
#include <numeric>

using namespace std;
typedef long long llong;
typedef unsigned long long ullong;

const ullong MOD = 1000000000 + 7;

int main()
{
	vector<int> a(4);
	vector<int> b(2);

	for (int i = 0; i < 4; i++)
	{
		cin >> a.at(i);
	}

	for (int i = 0; i < 2; i++)
	{
		cin >> b.at(i);
	}

	sort(a.begin(), a.end());
	reverse(a.begin(), a.end());

	sort(b.begin(), b.end());

	cout << accumulate(a.begin(), a.begin() + 3, 0) + b.back() << endl;
}