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<algorithm>
#include<string>
#include<deque>
using namespace std;
int main(){
	deque<int> a,b;
	int x;
	for(int i=0;i<10;i++){
		cin>>x;
		a.push_back(x);
	}
	for(int i=0;i<10;i++){
		cin>>x;
		b.push_back(x);
	}
	sort(a.begin(),a.end(),greater<int>());
	sort(b.begin(),b.end(),greater<int>());
	cout<<a[0]+a[1]+a[2]<<' '<<b[0]+b[1]+b[2]<<endl;
return 0;
}

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

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

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype

template <class T>
int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

template <class T> void max_swap(T& a, const T b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T b) { a = min(a, b); }

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


void hoge()
{
	int a[10];
	for (int i = 0; i < 10; ++i)
		scanf("%d", a + i);
	sort(a, a + 10);
	printf("%d", accumulate(a + 7, a + 10, 0));
}
int main()
{
	hoge();
	putchar(' ');
	hoge();
	putchar('\n');
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>

using namespace std;

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

C++: #include<iostream>
#include<queue>

using namespace std;

int main() {
	priority_queue<int> q; int p, ans;
	for(int n=0; n<2; ++n) {
		ans = 0;
		for(int i=0; i<10; ++i) {
			cin >> p;
			q.push(p);
		}
		for(int i=0; i<3; ++i) {
			ans += q.top(); q.pop();
		}
		while(!q.empty()) q.pop();
		cout << ans << (!n?" ":"");
	}
	cout << endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#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());
    cout << w[9]+w[8]+w[7] << " " << k[9] + k[8]+k[7] << endl;
    return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	int a[10];
	int mx[3];
	for(int i=0;i<10;i++)cin>>a[i];
	mx[0]=mx[1]=mx[2]=0;
	for(int i=0;i<10;i++){
		if(mx[0]<a[i]){
			mx[2]=mx[1];
			mx[1]=mx[0];
			mx[0]=a[i];
		}else if(mx[1]<a[i]){
			mx[2]=mx[1];
			mx[1]=a[i];
		}else if(mx[2]<a[i]){
			mx[2]=a[i];
		}
	}
	cout<<mx[0]+mx[1]+mx[2]<<" ";
	for(int i=0;i<10;i++)cin>>a[i];
	mx[0]=mx[1]=mx[2]=0;
	for(int i=0;i<10;i++){
		if(mx[0]<a[i]){
			mx[2]=mx[1];
			mx[1]=mx[0];
			mx[0]=a[i];
		}else if(mx[1]<a[i]){
			mx[2]=mx[1];
			mx[1]=a[i];
		}else if(mx[2]<a[i]){
			mx[2]=a[i];
		}
	}
	cout<<mx[0]+mx[1]+mx[2]<<endl;
	return 0;
}

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

int main () {
    int m=0, W[10], T[10], i;
    for(i=0;i<10;i++) {
        cin >> W[i];
    }
    sort(W,10);
    for(i=7;i<10;i++)
        m += W[i];
    cout << m << " ";
    for(i=0;i<10;i++) {
        cin >> T[i];
    }
    sort(T,10);
    for(i=7;i<10;i++)
        m += T[i];
    cout << m << endl;
}

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] << std::endl;
	std::cout << k[7] + k[8] + k[9] << std::endl;
	return 0;
}

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

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype

template <class T>
int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

template <class T> void max_swap(T& a, const T b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T b) { a = min(a, b); }

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


void hoge()
{
	int a[10];
	for (int i = 0; i < 10; ++i)
		scanf("%d", a + i);
	sort(a, a + 10);
	printf("%d", accumulate(a + 7, a + 10, 0));
}
int main()
{
	hoge();
	putchar(' ');
	hoge();
}

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

int main() {

	int W[10],K[10];

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

	while (i<20) {
		cin >> K[i];
		i++;
	}

	sort(W,W+10);
	sort(K,K+10);

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

	return 0;
}

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

int main() {
	int sum[2] = {0}, num[10] = { 0 }, i, j;
	for (j = 0; j < 2; j++) {
		for (i = 0; i < 10; i++) {
			cin >> num[i];
		}
		sort(num, num + 10);
		sum[j] = num[7] + num[8] + num[9];
	}
	cout << sum[0] << sum[1] << endl;
	return 0;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;

int main(){
	int i,j,point[20];
	for(i = 0;i < 20;i++){
		scanf("%d",&point[i]);
	}
	sort(point,point + 10);
	sort(point + 10,point + 20);
	printf("%d %d",point[7] + point[8] + point[9],point[17] + point[18] + point[19]);
	return 0;
}