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<cstdio>
#include <algorithm>
#include <functional>
#include <vector>

using namespace std;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

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

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

	sort(a,a+10);
	sort(b,b+10);


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

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

C++: #include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

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

//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
priority_queue<int> W,K;
int main()
{
  int x;
  for(int i = 0;i < 20;i++){
    scanf("%d",&x);
    if(i <10){
      W.push(x);
    }else
      K.push(x);
  }
  int a=0,b=0;
  for(int i = 0;i < 3;i++){
    a += W.top();
    W.pop();
    b +=K.top();
    K.pop();
  }
  cout <<a<<" ";
  cout <<b<<endl;

  return 0;
}

C++: #include <iostream>
#include<algorithm>
using namespace std;
int main(){

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


return 0;
}

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

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

int main() {
	vector<int> vw, vk;

	int tmp;
	for (int i = 0; i < 10; i++) {
		cin >> tmp;
		vw.push_back(tmp);
	}
	for (int i = 0; i < 10; i++) {
		cin >> tmp;
		vk.push_back(tmp);
	}

	sort(vw.begin(), vw.end());
	sort(vk.begin(), vk.end());

	int pw = 0, pk = 0;
	for (int i = 9; i >= 7; i--) {
		pw += vw[i];
		pk += vk[i];
	}

	cout << pw << " " << pk << endl;

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <cctype>
#include <complex>
#include <string>
#include <sstream>

using namespace std;

#define all(c) c.begin(),c.end()
#define rall(c) c.rbegin(),c.rend()
#define mp(a,b) make_pair((a),(b))
#define eq ==

typedef long long ll;
typedef complex<double> point;
typedef pair<int,int> pii;

// →↑←↓
const int dx[] = {1,0,-1,0};
const int dy[] = {0,-1,0,1};


const double EPS = 1e-9;

int main(){
    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(rall(W));
    sort(rall(K));

    int ws = W[0] + W[1] + W[2];
    int ks = K[0] + K[1] + K[2];

    cout << ws << " " << ks << endl;
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include <numeric>
#include<map>
 
 
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1e13
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
 
typedef long long int ll;
#define MOD 1000000007


int main(){

    vector<int> a(10),b(10);
    
    REP(i,10){
        cin >> a[i];
    }

    REP(i,10){
        cin >> b[i];
    }

    sort(a.begin(),a.end(),greater<int>());
    sort(b.begin(),b.end(),greater<int>());
    
    int a_sum = 0,b_sum = 0;
    REP(i,3){
        a_sum += a[i];
        b_sum += b[i];
    }
    cout << a_sum << " " << b_sum << endl;


    return 0;
}

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

int main(){

  int a[99], b[99];

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

  sort(a, a+10);
  sort(b, b+10);

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

}

C++: #include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>
using namespace std;
const int dx[] = {1,0,-1,0},dy[] = {0,1,0,-1};
#define INF 1e+8
#define EPS 1e-8
#define rep(i,j) for(int i = 0; i < (j); i++)
#define reps(i,j,k) for(int i = (j); i < (k); i++)
typedef long long ll;
typedef pair < int , int > Pii;
int main(){
	vector < int > vi;
	rep(i,10){
		int tmp;
		scanf("%d",&tmp);
		vi.push_back(tmp);
	}
	int ans1;
	stable_sort(vi.begin(),vi.end());
	ans1 = vi[9]+vi[8]+vi[7];
	vi.clear();
    rep(i,10){
		int tmp;
		scanf("%d",&tmp);
		vi.push_back(tmp);
	}
	int ans2;
	stable_sort(vi.begin(),vi.end());
	ans2 = vi[9]+vi[8]+vi[7];
	printf("%d %d\n",ans1,ans2);
	return 0;
}

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


int main(){
  int w[10],k[10];
  int wmax1=0,wmax2=0,wmax3=0,kmax1=0,kmax2=0,kmax3=0;
  int wtotal=0,ktotal=0;
  for(int i=0;i<10;i++){
    cin>>w[i];
  }
  for(int i=0;i<10;i++){
    cin>>k[i];
  }
  for(int j=0;j<10;j++){
    if(wmax1<w[j]){
      wmax3=wmax2;
      wmax2=wmax1;
      wmax1=w[j];
    }else if(wmax2<w[j]){
      wmax3=wmax2;
      wmax2=w[j];
    }else if(wmax3<w[j]){
      wmax3=w[j];
    }
  }
  for(int j=0;j<10;j++){
    if(kmax1<k[j]){
      kmax3=kmax2;
      kmax2=kmax1;
      kmax1=k[j];
    }else if(kmax2<k[j]){
      kmax3=kmax2;
      kmax2=k[j];
    }else if(kmax3<k[j]){
      kmax3=k[j];
    }
  }
  wtotal=wmax1+wmax2+wmax3;
  ktotal=kmax1+kmax2+kmax3;
  cout<<wtotal<<" "<<ktotal<<endl;

  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    vector<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.rbegin(), w.rend());
    sort(k.rbegin(), k.rend());

    cout << accumulate(w.begin(), w.begin()+3, 0) << ' '
         << accumulate(k.begin(), k.begin()+3, 0) << endl;
}