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>
using namespace std;

int main(){
	/*
	int a,b,c,d,e;

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

	int x;

	if(a > 0){
		x = e*(b-a);
	}
	if(a == 0){
		x = e*b + d;
	}
	if(a < 0){
		x = -c*a + e*b + d;
	}

	cout << x <<endl;
	*/

	
	int a,b,c,d,e,f;
	cin >> a >> b >> c >> d >> e >> f;
	int m,n;
	int x = a + b + c + d + e + f;


	
	if(e<f)
	{
		x = x - e;
		if(a<b)
		{
			if(a<c)
			{
				if(a<d)
				{
					cout << x-a << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
		else
		{
			if(b<c)
			{
				if(b<d)
				{
					cout << x-b << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
	}
	else
	{
		x = x - f;
		if(a<b)
		{
			if(a<c)
			{
				if(a<d)
				{
					cout << x-a << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
		else
		{
			if(b<c)
			{
				if(b<d)
				{
					cout << x-b << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
	}
	


	return 0;
}

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

int main(){
	int s[4];
	int m_max;
	int h[3];
	int h_max;
	for(int i = 0;i<4;i++){
		cin>>s[i];
		m_max += s[i];
	}
	m_max -= (min(s[0],min(s[1],min(s[2],s[3]))));
	for(int i = 0;i<3;i++){
		cin>>h[i];
		h_max+=h[i];
	}
	h_max -= (min(h[0],min(h[1],h[2])));
	m_max += h_max;
	cout<<m_max<<endl;
}

C++: #include <cstdio>
#include <cctype>
#include <utility>
#include <array>
#include <algorithm>
using namespace std;

#define _gp(l) const auto gcu{getchar##l}; const auto pcu{putchar##l}
#ifdef __linux
_gp(_unlocked);
#else
_gp();
#endif
#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept
#define _T template<typename T>
#define _HT template<typename H,typename... T>
_T _DEF(T,in,int c){T n{};int m{1};while(isspace(c)){c=gcu();}if(c=='-')m=-1,c=gcu();do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}
_DEF(int,in,){return in<int>(gcu());}
#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)
_SCAN(char &c){c=gcu();gcu();return c!=EOF;}
_T _SCAN(T &n){int c{gcu()};return c==EOF?false:(n=in<T>(c),true);}
#define _OUT(...) _DEF(void,out,__VA_ARGS__)
#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)
_OUT(bool b){pcu('0'+b);}
_OUT(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_SCAN(string &s){int c;s="";for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=(char)c;}}
_OUT(string s){for(char c:s)pcu(c);}
#endif
_OUT(const char *s){while(*s)pcu(*s++);}
_T _OUT(T n){static char b[20];char *p{b};T m=n<0?pcu('-'),-1:1;if(!n)*p++='0';else while(n)*p++=(char)(n%10*m+'0'),n/=10;while(p!=b)pcu(*--p);}
_OUTL(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _OUT(vector<T> v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);}
#endif
_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}
_HT _OUT(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _OUTL(T&&... t){out(move(t)...);outl();}
struct range{int e,b{0},s{1};range(int _b,int _e,int _s):e(_e),b(_b),s(_s){}range(int _b,int _e):e(_e),b(_b){}range(int _e):e(_e){}
	struct it{int v,s;it(int _v,int _s):v(_v),s(_s){}operator int()const{return v;}operator int&(){return v;}int operator*()const{return v;}it& operator++(){v+=s;return *this;}};
	it begin(){return{b, s};}it end(){return{e,s};}};

int main() {
	array<int, 4> s;
	int a {};
	for (int &i: s)
		a += i = in();
	outl(a - *min_element(begin(s), end(s)) + max(in(), in()));
}

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

int main() {
  int sum = 0;
  int min = 100;
  for(int i=0; i<4; i++) {
    int tmp;
    cin >> tmp;
    sum += tmp;
    if(tmp < min) min = tmp;
  }
  sum -= min;
  
  int max = 0;
  for(int i=0; i<2; i++) {
    int tmp;
    cin >> tmp;
    if(tmp > max) max = tmp;
  }
  sum += max;
  cout << sum << endl;
}

C++: #include <iostream>

using namespace std;

int main()
{
  int score;
  int sum_of_scores = 0;
  int max = 0;
  int min = 100;

  for (int i = 0; i < 6; i++) {
    cin >> score;
    if (i < 4) {
      sum_of_scores += score;
      if (score < min) min = score;
    } else {
      if (score > max) max = score;
    }
  }
  sum_of_scores  = sum_of_scores  - min + max;

  cout << sum_of_scores << endl;
}

C++: #include<stdio.h>
int main(void)
{
	int i,a,b,min,sum;
	sum=0;
	scanf("%d",&min);
	for(i=0;i<3;i++){
		scanf("%d",&a);
		if(min>a){
			sum+=min;
			min=a;
		}
		else sum+=a;
	}
	scanf("%d%d",&a,&b);
	if(a<b) sum+=b;
	else sum+=a;
	printf("%d\n",sum);
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int a;
int b;
int c;
int d;
int e;
int f;

int main(){
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	cin >> e;
	cin >> f;
	int x = max(e, f);
	int t = min(a, (min(b, (min(c,d)))));
	cout << x + (a + b + c + d) - t << endl;
	
	return 0;
}

C++: #include<bits/stdc++.h>
#define int long long int
#define MP make_pair
#define PB push_back
#define F first
#define S second
using namespace std;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef vector<PII> VP;

int a, b, c, d, e, f;
signed main()
{
  cin >> a >> b >> c >> d >> e >> f;
  cout << a + b + c + d + e + f - min({a, b, c, d}) - min(e, f) << endl;
  return 0;
}

C++: #include <stdio.h>
#include <algorithm>

using namespace std;

int main()
{
	int sum = 0;
	int a[4], b[2];

	for (int i = 0; i < 4; i++)
	{
		scanf("%d", &a[i]);
	}
	for (int i = 0; i < 2; i++)
	{
		scanf("%d", &b[i]);
	}
	sort(rbegin(a), rend(a));
	sum = max(b[0], b[1]);
	for (int i = 0; i < 3; i++)
	{
		sum += a[i];
	}

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

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

C++: #include<iostream>
using namespace std;
int i, sumrika=0, sumsha=0, t, u, cnt=0;
int minrika=110, minsha=110;
int rika[5], sha[3];
int main(){
for(i=1; i<=4; i++){
   cin>>rika[i]; sumrika+=rika[i];
   if(rika[i]<minrika){minrika=rika[i];}
}
for(i=1; i<=2; i++){
    cin>>sha[i]; sumsha+=sha[i];
    if(sha[i]<minsha){minsha=sha[i];}
}
int disp = (sumrika-minrika)+(sumsha-minsha);
cout << disp << endl;
}

C++: #include <bits/stdc++.h>
const double PI = acos(-1);
#define rep(i, n) for (int i = 0; i < (int)(n); i++ )
using namespace std;
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int main(){
  int a, b, c, d, e, f;
  cin >> a >> b >> c >> d >> e >> f;
  vector<int> scinence = {a,b,c,d};
  vector<int> sorcial = {e,f};
  sort(scinence.begin(), scinence.end());
  int ans = 0;
  for(int i = 3; i > 0;--i) ans += scinence.at(i);
  ans += max(e,f);
  cout << ans << endl;
}