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 <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EACH(t,i,c) for(t::iretator i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,n-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);

int main() {
	vi W, K;

	int tmp;
	REP(i, 10) {
		cin >> tmp;
		W.push_back(tmp);
	}
	REP(i, 10) {
		cin >> tmp;
		K.push_back(tmp);
	}

	sort(RALL(W));
	sort(RALL(K));

	int sW = 0, sK = 0;
	REP(i, 3) {
		sW += W[i];
		sK += K[i];
	}

	cout << sW << " " << sK << endl;

	return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int w[10],k[10],i,j,x,y;
	for(i=0;i<10;i++){
		scanf("%d",&w[i]);
	}
	for(i=0;i<10;i++){
		scanf("%d",&k[i]);
	}
	sort(w,w+10,greater<int>());
	sort(k,k+10,greater<int>());
	for(i=0;i<3;i++){
		x+=w[i];
		y+=k[i];
	}
	printf("%d %d\n",x,y);
	return 0;
}

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

#define repi(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) for(int i=0;i<(n);i++)

int main() {
	ios::sync_with_stdio(false);
	
	int w[3]={}, k[3]={};
	int a;
	
	rep(i, 10) {
		cin >> a;
		if(w[0]<a) {
			w[2]=w[1];
			w[1]=w[0];
			w[0]=a;
		}else if(w[1]<a) {
			w[2]=w[1];
			w[1]=a;
		}else if(w[2]<a) {
			w[2]=a;
		}
	}
	
	rep(i, 10) {
		cin >> a;
		if(k[0]<a) {
			k[2]=k[1];
			k[1]=k[0];
			k[0]=a;
		}else if(k[1]<a) {
			k[2]=k[1];
			k[1]=a;
		}else if(k[2]<a) {
			k[2]=a;
		}
	}
	
	rep(i, 2) {
		w[2]+=w[i];
		k[2]+=k[i];
	}
	
	cout << w[2] << " " << k[2] << endl;
	
	return 0;
}

C++: #include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

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


int main(){

	int s;
	vector<int>W,K;

	rep(i,20){

		cin >> s;
		if(i<10) W.push_back(s);
		else K.push_back(s);
	}

	sort(W.begin(),W.end()); sort(K.begin(),K.end());

	cout << W[9]+W[8]+W[7] << " " << K[9]+K[8]+K[7] << endl;

	return 0;
}

C++: #include<iostream>
#include <algorithm>
using namespace std;
int main()
{
	int j,w[11],k[11],i,wg,kg;
	for(i=0;i<10;i++)
	{
		cin>>w[i];
	}
	for(i=0;i<10;i++)
	{
		cin>>k[i];
	}
	sort(w,w+11);
	sort(k,k+11);
	wg=w[7]+w[8]+w[9];
	kg=k[7]+k[8]+k[9];
		cout<<wg<<" "<<kg<<endl;
	return 0;
}

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

using namespace std;

int main(){
	vector<int> a(10);
	vector<int> b(10);
	for(int i=0;i<10;i++){
		cin >> a[i];
	}
	for(int i=0;i<10;i++){
		cin >> b[i];
	}
	reverse(a.begin(),a.end());
	reverse(b.begin(),b.end());
	sort(a.begin(),a.end());
	cout << a[0] + a[1] + a[2] << " ";
	sort(b.begin(),b.end());
	cout << b[0] + b[1] + b[2] << endl;
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>
#include <iomanip>
#include <random>
#include <complex>
#include <functional>
#include <tuple>

using namespace std;

#define Rep(i,a,b) for(ll i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")

using ll = long long;

constexpr int inf = 1e9 + 7;
constexpr ll infll = 1ll << 60ll;
constexpr ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

namespace {
    template<typename T> void chmax(T& a, T b) { a = std::max(a, b); }
    template<typename T> void chmin(T& a, T b) { a = std::min(a, b); }
    template<typename T> void chadd(T& a, T b) { a = a + b; }

    void Cout(long long x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const T& x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const std::vector<T>& x, const char* sep = " ", const char* end = "\n") { for (std::size_t i = 0, sz = x.size(); i < sz; i++) { std::cout << x[i] << (i == sz - 1 ? end : sep); } }

    // 標準入出力
    struct inp {
        std::size_t sz;
        inp(std::size_t _sz = 1) : sz(_sz) {}
        template <typename T> operator T () const { T a; std::cin >> a; return a; }
        template <typename T> operator std::vector<T>() const { std::vector<T> a(sz); for (std::size_t i = 0; i < sz; i++) std::cin >> a[i]; return a; }
    };

    // 2次元用の標準入出力
    template<typename T>
    struct inpn {
        std::size_t szi, szj;
        inpn(std::size_t _szi, std::size_t _szj) : szi(_szi), szj(_szj) {}
        operator std::vector<std::vector<T>>() const {
            std::vector<std::vector<T>> a(szi, std::vector<T>(szj));
            for (std::size_t i = 0; i < szi; ++i)
                for (std::size_t j = 0; j < szj; ++j) cin >> a[i][j];
            return a;
        }
    };

    inp inp1; // input one
}


int main() {

    vector<int> w = inp(10);
    vector<int> s = inp(10);

    sort(allof(w), greater<int>());
    sort(allof(s), greater<int>());

    int first = w[0] + w[1] + w[2];
    int second = s[0] + s[1] + s[2];

    cout << first << " " << second << endl;

    return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;main(){int n[20];for(int i=0;i<20;i++)cin>>n[i];sort(n,n+10);reverse(n,n+10);sort(n+11,n+20);reverse(n+11,n+20);cout<<(n[0]+n[1]+n[2])<<" "<<(n[10]+n[11]+n[12])<<endl;}

C++: #include<algorithm>
#include<iostream>
using namespace std;
int main(){
int i,t[20];
for(i=0;i<20;i++){
cin>>t[i];
}
sort(t,t+10);
sort(t+10,t+20);
cout<<t[0]+t[1]+t[2]<<" "<<t[10]+t[11]+t[12]<<endl;
return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>

using namespace std;

int main(void)
{
    int wsd[10], ko[10];
    for(int i=0; i<10; i++) cin>>wsd[i];
    for(int i=0; i<10; i++) cin>>ko[i];
    sort(wsd, wsd+10);
    sort(ko, ko+10);
    printf("%d %d\n",wsd[9]+wsd[8]+wsd[7], ko[9]+ko[8]+ko[7]);

    return 0;
}

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

int w[10],k[10];

int main(){
  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);
  cout<<(w[7]+w[8]+w[9])<<" ";
  cout<<(k[7]+k[8]+k[9])<<endl;
  return 0;
}