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 <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <stdlib.h>

using namespace std;

int main (void)
{
	int a[10],b[10],w1,w2,w3,k1,k2,k3;

	w1 = 0;
	w2 = 0;
	w3 = 0;
	k1 = 0;
	k2 = 0;
	k3 = 0;

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

	for (int i = 0; i < 10; i++)
	{
		if (a[i] > w1 && a[i] > w2)
		{
			w2 = w1;
			w3 = w2;
			w1 = 0;
			w1 = a[i];
		}
		else if (a[i] <= w1 && a[i] > w2)
		{
			w3 = w2;
			w2 = 0;
			w2 = a[i];
		}
		else if (a[i] <= w2 && a[i] > w3)
		{
			w3 = 0;
			w3 = a[i];
		}
		else
		{
		}
	}

	for (int j = 0; j < 10; j++)
	{
		if (b[j] > k1 && b[j] > k2)
				{
			k2 = k1;
			k3 = k2;
					k1 = 0;
					k1 = b[j];
				}
				else if (b[j] <= k1 && b[j] > k2)
				{
					k3 = k2;
					k2 = 0;
					k2 = b[j];
				}
				else if (b[j] <= k2 && b[j] > k3)
				{
					k3 = 0;
					k3 = b[j];
				}
				else
				{
				}
	}

	cout << w1 + w2 + w3 << " "  << k1 + k2 + k3 << endl;
}

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

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

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm>
#include <numeric>
#include <typeinfo>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int main()
{
	vi w(10),k(10);
	rep(i,10)
		cin>>w[i];
	rep(i,10)
		cin>>k[i];
	sort(allof(w),greater<int>());
	sort(allof(k),greater<int>());
	cout<<accumulate(allof(w)-7,0)<<endl;
	cout<<accumulate(allof(k)-7,0)<<endl;
	
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
  vector<int>W(10);
  vector<int>H(10);
  for(int i=0;i<10;i++)
    cin>>W[i];
  for(int i=0;i<10;i++)
    cin>>H[i];
  sort(W.begin(),W.end(),greater<int>());
  sort(H.begin(),H.end(),greater<int>());
  cout<<W[0]+W[1]+W[2]<<" "<<H[0]+H[1]+H[2]<<endl;
  return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
using namespace std;
int main(){
  vector<int>a(10,0),b(10,0);
  rep(i,10){
    cin>>a[i];
  }
  rep(i,10){
    cin>>b[i];
  }
  sort(all(a));
  sort(all(b));
  cout<<a[9]+a[8]+a[7]<<" "<<b[9]+b[8]+b[7]<<endl;
}

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

void sort(int*,int);
void swap(int*,int);

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

void sort(int a[],int n){
	int k=1;
	int p;
	while(k){
		k=0;
		for(int i=0;i<n-1;i++){
			if(a[i]<a[i+1]){
				swap(a,i);
				k=1;
			}
		}
		for(int i=n-1;i>0;i--){
			if(a[i]>a[i-1]){
				swap(a,i-1);
				k=1;
			}
		}
		
		
	}
}

void swap(int a[],int i){
	int p=a[i];
	a[i]=a[i+1];
	a[i+1]=p;
	return;
}

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

// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
#define PI (2*acos(0.0))
#define EPS (1e-9)
#define MOD (int)(1e9+7)
#define INF numeric_limits<int>::infinity()
#pragma endregion


int main()
{
    vi v1, v2;
    rep(i,10) {
        int a;
        cin >> a;
        v1.push_back(a);
    }
    rep(i,10) {
        int a;
        cin >> a;
        v2.push_back(a);
    }

    sort(v1);
    sort(v2);
    printf("%d %d\n", v1[9]+v1[8]+v1[7], v2[9]+v2[8]+v2[7]);
    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int data[10];
	int dai1,dai2,wk;
	int i,j;
	for(i=0;i<10;i++){
		scanf("%d",&data[i]);
	}
	for(i=0;i<9;i++){
		for(j=i+1;j<10;j++){
			if(data[i]<data[j]){
				wk=data[i];
				data[i]=data[j];
				data[j]=wk;
			}
		}
	}
	dai1=data[0]+data[1]+data[2];
	for(j=0;j<10;j++){
		scanf("%d",&data[j]);
	}
	for(j=0;j<9;j++){
		for(i=j+1;i<10;i++){
			if(data[j]<data[i]){
				wk=data[j];
				data[j]=data[i];
				data[i]=wk;
			}
		}
	}
	dai2=data[0]+data[1]+data[2];
	printf("%d %d\n",dai1,dai2);
	return 0;
}