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 <stdio.h>
#include <iostream>

int main(void){
	int w[10], k[10], swap[1];
	int i, j;
	for (i = 0; i < 10; ++i){
		scanf("%d", &w[i]);
	}
	for (i = 0; i < 10; ++i){
		scanf("%d", &k[i]);
	}
	for (i = 0; i < 10; ++i){
		for (j = 0; j < 10-1; ++j){
			if (w[j] < w[j+1]){
				swap[0] = w[j];
				swap[1] = w[j+1];

				w[j] = swap[1];
				w[j+1] = swap[0];
			}
		}
	}
	for (i = 0; i < 10; ++i){
		for (j = 0; j < 10-1; ++j){
			if (k[j] < k[j+1]){
				swap[0] = k[j];
				swap[1] = k[j+1];

				k[j] = swap[1];
				k[j+1] = swap[0];
			}
		}
	}
	printf("%d %d\n", w[0]+w[1]+w[2], k[0]+k[1]+k[2]);
	return 0;
}

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

int main(){
	int a[10];
	int 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);
	int w = a[7]+a[8]+a[9];
	int h = b[7]+b[8]+b[9];
	cout << w << " " << h << endl;
}

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

int W[10], K[10];

int main(void) {
	for (int i = 0; i < 10; ++i) { scanf("%d", &W[i]); }
	for (int i = 0; i < 10; ++i) { scanf("%d", &K[i]); }

	std::sort(W, W + 10, std::greater<int>());
	std::sort(K, K + 10, std::greater<int>());

	printf("%d %d\n", W[0] + W[1] + W[2], K[0] + K[1] + K[2]);
	return 0;
}

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

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define sz size()

const double EPS = 1e-10;
const int INF = 100000000;

int solve(int n){
    int ret=0;
    int m[]={500,100,50,10,5,1};
    rep(i,6){
        ret+=n/m[i];
        n-=m[i]*(n/m[i]);
    }
    return ret;
}


int main(){
    vi a,b;
    rep(j,10){
        int k;
        cin>>k;
        a.pb(k);
    }
    rep(j,10){
        int k;
        cin>>k;
        b.pb(k);
    }
    sort(all(a));
    sort(all(b));
    
    cout<<(a[9]+a[8]+a[7])<<" "<<(b[9]+b[8]+b[7])<<endl;
    
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <fstream>
#include <algorithm>
#include <math.h>
#include <map>
using namespace std;

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

bool has_key_using_count(map<char, char> &m, char n){
    if (m.count(n) == 0){
        return false;
    }
    else{
        return true;
    }
}

int main()
{	
	//ifstream cin("sample.txt");

	vector<int> W, K;
	int n = 10, top = 3, t = 0, sumW = 0, sumK = 0;
	
	W.clear(); K.clear();
	rep(i, n) {
		cin >> t;
		W.push_back(t);
	}
	rep(i, n) {
		cin >> t;
		K.push_back(t);
	}

	// テ」ツつステ」ツδシテ」ツδ?
	sort(W.begin(), W.end(), greater<int>());
	sort(K.begin(), K.end(), greater<int>());

	// テ、ツクツ甘」ツ?凝」ツつ?テ、ツコツコテ」ツ?ョテ・ツセツ療ァツつケテ」ツつ津・ツ環?ァツョツ?
	rep(i, top) {
		sumW += W[i];
		sumK += K[i];
	}

	cout << sumW << " " << sumK << endl;

	return 0;
}

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

int p[10];

int main(){
	for(int i = 0; i < 2; i++){
		int ans = 0;
		for(int j = 0; j < 10; j++) scanf("%d", &p[j]);
		sort(p,p+10,greater<int>());
		for(int j = 0; j < 3; j++) ans += p[j];
		if(i == 0) printf("%d", ans);
		else printf(" %d\n", ans);
	}
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	vector<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.begin(),a.end());
	sort(b.begin(),b.end());
	cout << a[9]+a[8]+a[7] << ' ' << b[9]+b[8]+b[7] << endl;
	return 0;
}

C++: #include<algorithm>
#include<cstdio>
#define s(A)std::sort(A,A+10);
main(){
int Z[20],i=0;
for(;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]);
}

C++: #include<iostream>
using namespace std;
int main(){
int w[10],k[10],tmp,i,j;
for(i=0;i<10;i++){
cin>>w[i];
}
for(i=0;i<10;i++){
cin>>k[i];
}
for(i=0;i<9;i++){
for(j=9-i;j>0;j--){
if(w[j]>w[j-1]){
tmp=w[j];
w[j]=w[j-1];
w[j-1]=tmp;
}
if(k[j]>k[j-1]){
tmp=k[j];
k[j]=k[j-1];
k[j-1]=tmp;
}
}
}
cout<<w[0]+w[1]+w[2]<<" "<<k[0]+k[1]+k[2]<<endl;
return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.answer"
int main() {
	for (int i = 0; i < 2; ++i) {
		if (i)cout << " ";
		vector<int>vs(10);
		for (int j = 0; j < 10; ++j) {
			cin >> vs[j];
		}
		sort(vs.begin(), vs.end());
		cout << vs[7] + vs[8] + vs[9];
	}
	cout << endl;
	return 0;
}

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

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 (w.begin (),w.end());
	sort (k.begin(),k.end());
	int wc=0,kc=0;
	for (int i=9;i>6;i--){
		wc+=w[i];
		kc+=k[i];
		}
	cout << wc <<" " << kc;		  
		return 0;
}

C++: //a
#include <iostream>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <memory>
#include <functional>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>

#define REP(i,b,n) for(int i=b;i<n;i++)
#define REPR(i,b,n) for(int i=n-1;i>=b;i--)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define EACH(i, c) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define BIT(n, b) ((n>>b) & 1)
#define PB push_back
#define MP make_pair

using namespace std;

static const double PI = acos(-1.0);
static const double EPS = 1e-9;
typedef long long ll;
typedef pair<int, int> pii;

vector<int> w, k;

int main(){
	
	int a, ws=0, ks=0;
	
	for(int i=0; i<10; ++i){
		cin>>a;
		w.push_back(a);
	}
	
	for(int i=0; i<10; ++i){
		cin>>a;
		k.push_back(a);
	}
	
	sort(RALL(w));sort(RALL(k));
	
	cout << w[0]+w[1]+w[2] << " " << k[0]+k[1]+k[2] << endl;
	
	return 0;	
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n[10],m[10],i;
  for(i=0;i<10;i++){
    cin>>n[i];
  }
  for(i=0;i<10;i++){
    cin>>m[i];
  }
  sort(n,n+10);
  sort(m,m+10);
  reverse(n,n+10);
  reverse(m,m+10);
  cout<<n[0]+n[1]+n[2]<<" "<<m[0]+m[1]+m[2]<<endl;
  return 0;
}

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

int main(){
  int x,i;
  vector<int>w,k;
  for(i=0;i<10;i++)scanf("%d",&x),w.push_back(x);
  for(i=0;i<10;i++)scanf("%d",&x),k.push_back(x);
  sort(w.begin(),w.end());
  sort(k.begin(),k.end());
  printf("%d %d\n",w[7]+w[8]+w[9],k[7]+k[8]+k[9]);
}