Go: package main

import (
	"fmt"
	"sort"
)

func calcScore(n, m []int) (int, int) {
	sort.Ints(n)
	sort.Ints(m)
	
	return n[9] + n[8] + n[7], m[9] + m[8] + m[7]
}

func main(){
	var team_W, team_K []int
	var inp int
	
		for i := 0; i < 10; i++ {		
			fmt.Scan(&inp)
			team_W = append(team_W, inp)
		}

		for j := 0;  j< 10; j++ {		
			fmt.Scan(&inp)
			team_K = append(team_K, inp)
		}

	fmt.Println(calcScore(team_W, team_K))
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#define REP(i,n) for(int i = 0;i < (n);i++)
#define pb push_back
using namespace std;
const int INF = 1e9;
typedef long long ll;

int main(){
  vector <ll> a;
  vector <ll> b;
  REP(i,10){
    ll c;
    cin >> c;
    a.pb(c);
  }
  REP(i,10){
    ll c;
    cin >> c;
    b.pb(c);
  }
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  ll sum = 0;
  ll s = 0;
  for(int i = b.size()-1;i > b.size()-4;i--){
    sum += a[i];
    s += b[i];
  }
  cout << sum << " " << s << endl;
  
}

C++: #include<iostream>
#include<string>
using namespace std;
int W[10];int K[10];	 
    int fir=0;
    int sec=0;
    int thi=0;
    int fir2=0;
    int sec2=0;
    int thi2=0;
int main(){
	for(int i=0;i<10;i++){
	cin>>W[i];}
	for(int i=0;i<10;i++){
	cin>>K[i];}

    for(int i=0;i<10;i++){
    if(W[i]>fir){
    thi=sec;
    sec=fir;
    fir=W[i];}else
    if(W[i]>sec){
    thi=sec;
    sec=W[i];}else
    if(W[i]>thi){
    thi=W[i];}}
    for(int i=0;i<10;i++){
    if(K[i]>fir2){
    thi2=sec2;
    sec2=fir2;
    fir2=K[i];}else
    if(K[i]>sec2){
    thi2=sec2;
    sec2=K[i];}else
    if(K[i]>thi2){
    thi2=K[i];}}
	cout<<fir+sec+thi<<" "<<fir2+sec2+thi2<<endl;

		return 0;
	}

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

int main()
{
	vector<int> k(10), w(10);
	for (int i = 0; i < 10; ++i) cin >> w[i]; 
	for (int i = 0; i < 10; ++i) cin >> k[i];
	sort(k.begin(), k.end());
	sort(w.begin(), w.end());
	cout << w[9]+w[8]+w[7] << " " << k[9]+k[8]+k[7] << endl;
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
  vector<int> W,K;
  for(int i=0,j; i<10; i++){
    cin >>j;
    W.push_back(j);
  }
  for(int i=0,j; i<10; i++){
    cin >>j;
    K.push_back(j);
  }
  sort(W.begin(),W.end());
  sort(K.begin(),K.end());
  cout <<W[9]+W[8]+W[7]<<endl<<K[9]+K[8]+K[7]<<endl;
  return 0;
}

C++: #include<algorithm>
#include<cstdio>
#define s(A)std::sort(A,A+10);
main(){
int Z[20];
for(int i=0;i<20;)
scanf("%d",Z+i++);
s(Z);
s(Z+10);
printf("%d %d\n",Z[7]+Z[8]+Z[9],Z[17]+Z[18]+Z[19]);
return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int p[10],ans,l=0;
  for(int n=0;n<2;n++){
    for(int i=0;i<10;i++) cin >> p[i];
    sort(p,p+10,greater<int>());
    ans = p[0]+p[1]+p[2];
    cout << ans;
    if(l==0) cout << ' ';
    else cout << endl;
    l++;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
   vector<int>W(10);
   vector<int>K(10);
   for(int i=0;i<10;i++)cin>>W.at(i);
   for(int i=0;i<10;i++)cin>>K.at(i);
   sort(W.begin(),W.end(),greater<int>());
    sort(K.begin(),K.end(),greater<int>());
    cout<<W.at(0)+W.at(1)+W.at(2)<<" "<<K.at(0)+K.at(1)+K.at(2)<<endl;
}

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

using namespace std;

int main()
{
	int a;
//	int w[10] = {0};
//	int k[10] = {0};
	
	vector<int> w(10);
	vector<int> k(10);
	
	for(int i = 0; i < 10; i++){
		cin >> w[i];
	}
	
	for(int i = 0; i < 10; i++){
		cin >> k[i];
	}
	
	sort(w.begin(), w.end()); 
	sort(k.begin(), k.end());
	
	printf("%d %d",w[9]+w[8]+w[7],k[9]+k[8]+k[7] );
	
	return 0;
}

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

int main() {
  int W[10], K[10];
  for (int i = 0; i < 10; i++) cin >> W[i];
  for (int i = 0; i < 10; i++) cin >> K[i];
  sort(W, W + 10, greater<int>());
  sort(K, K + 10, greater<int>());
  cout << W[0] + W[1] + W[2] << " " << K[0] + K[1] + K[2] << endl;
  return 0;
}

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

vector<int> a(10), b(10);

int main()
{
    for (int i = 0; i < 10; i++)
    {
        cin >> a[i];
    }
    for (int i = 0; i < 10; i++)
    {
        cin >> b[i];
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    cout << a[7] + a[8] + a[9] << " " << b[7] + b[8] + b[9] << endl;
}

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

using namespace std;


int a[10], b[10];

int main(){
	for(int i = 0;i < 10;i++){
		cin >> a[i];
	}
	sort(a, a + 10);
	for(int i = 0;i < 10;i++){
		cin >> b[i];
	}
	sort(b, b + 10);

	cout << a[9] + a[8] + a[7] << " " << b[9] + b[8] + b[7] << endl;
	return 0;
}

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

int main(){
    vector<int> w, k;
    int b;
    for (int i = 0; i < 10; i++){
	cin >> b;
	w.push_back(b);
    }
    for (int i = 0; i < 10; i++){
	cin >> b;
	k.push_back(b);
    }

    sort(w.begin(), w.end(), greater<int>());
    sort(k.begin(), k.end(), greater<int>());
    int ww = 0, kk = 0;
    for (int i = 0; i < 3; i++) ww += w[i];
    for (int i = 0; i < 3; i++) kk += k[i];

    cout << ww << " " << kk << endl;
}

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

int main() {
	int w[11],k[11],p;
	for(int i=1; i<=10; i++){
		cin>>w[i];
		p=i;
		if(i>1){
			while(p>1){
				if(w[p]>w[p-1]){
					w[p-1]=w[p];
					p=p-1;
				}
				else
					break;
			}
		}
	}
	for(int i=1; i<=10; i++){
		cin>>k[i];
		p=i;
		if(i>1){
			while(p>1){
				if(k[p]>k[p-1]){
					k[p-1]=k[p];
					p=p-1;
				}
				else
					break;
			}
		}
	}
	cout<<w[1]+w[2]+w[3]<<" "<<k[1]+k[2]+k[3];
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <queue>
#include <stack>
#include <set>

using namespace std;

#define ALL(co) co.begin(), co.end()
#define tpl(...) make_tuple(__VA_ARGS__)

typedef long long LL;
typedef pair<int, int> P; typedef pair<int, P> IP; typedef pair<P, P> PP;
typedef vector<int> Array; typedef vector<vector<int> > Array2;
typedef vector<LL> LArray; typedef vector<P> PArray; typedef vector<string> SArray;

const int INF = 1 << 29;
const LL LINF = 1LL << 60;

inline int getInt() { int itiv; return (cin >> itiv, itiv); }
template <typename T> void readAll(vector<T>& vec) { for (int i = 0, size = vec.size(); i < size; i++) cin >> vec[i]; }
template <typename T, typename U> void readAll(vector<pair<T, U> >& vec) { for (int i = 0, size = vec.size(); i < size; i++) cin >> vec[i].first >> vec[i].second; }
template < typename T > inline string toString( const T &a ){ ostringstream oss; oss << a; return oss.str(); };
inline bool between(int min, int max, int n) { return min <= n && n <= max; }
inline bool inRange(int begin, int end, int n) { return begin <= n && n < end; }
inline bool inRange(int size, int n) { return 0 <= n && n < size; }

int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, -1, 0, 1 };
int dr[] = { 0, -1, 0, 1 }, dc[] = { -1, 0, 1, 0 };

int m, n;

int main(void)
{
	Array w(10), k(10);
	readAll(w); readAll(k);
	sort(ALL(w)); sort(ALL(k));
	int ws = 0, ks = 0;
	for (int i = 0; i < 3; i++)
	{
		ws += w[9 - i];
		ks += k[9 - i];
	}
	cout << ws << ' ' << ks << endl;
	return 0;
}

C++: #include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

int main() {
  int w[10];
  int k[10];
  for (int i = 0; i < 10; i++)
    cin >> w[i];
  for (int i = 0; i < 10; i++)
    cin >> k[i];

  sort(w, w + 10);
  sort(k, k + 10);

  int sum_w = w[7] + w[8] + w[9];
  int sum_k = k[7] + k[8] + k[9];

  cout << sum_w << " " << sum_k;
}