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<vector>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	long long n = 0, sum = 0; int a[22] = { 0 }, b[22] = { 0 };
	for (int h = 0; h < 10; h++) {
		cin >> a[h];
	}
	sort(a, a + 10);
	n += a[7]; n += a[8]; n += a[9];
	for (int h = 0; h < 10; h++) {
		cin >> b[h];
	}
	sort(b, b + 10);
	sum += b[9] + b[8] + b[7];
	cout << n << ' ' << sum << endl;
	cin >> n;
}

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

int main(){

  vector<int>w,k;
  for(int i=0;i<10;i++){
    int n;
    cin>>n;
    w.push_back(n);
  }
  for(int i=0;i<10;i++){
    int n;
    cin>>n;
    k.push_back(n);
  }

  sort(w.begin(),w.end());
  sort(k.begin(),k.end());

  cout<<w[9]+w[8]+w[7]<<" "<<k[9]+k[8]+k[7]<<endl;

}

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\n",point[7] + point[8] + point[9],point[17] + point[18] + point[19]);
	return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
int comp(const void *a,const void *b){
  int p=*(int*)a;
  int q=*(int*)b;
  return q-p;
}

int main(){
  int a[2][10];
  for(int i=0;i<2;i++){
    for(int j=0;j<10;j++)scanf("%d",&a[i][j]);
    qsort(a[i],10,sizeof(int),comp);
  }
  printf("%d %d\n",a[0][0]+a[0][1]+a[0][2],a[1][0]+a[1][1]+a[1][2]);
  return 0;
}

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

int main()
{
	int w[10], k[10], ans1, ans2;
	
	for (int i = 0; i < 10; i++){
		scanf("%d", &w[i]);
	}
	for (int i = 0; i < 10; i++){
		scanf("%d", &k[i]);
	}
	
	sort(w, w+10);
	sort(k, k+10);
	
	ans1 =  w[9] + w[8] + w[7];
	ans2 =  k[9] + k[8] + k[7];
	
	
	printf("%d %d\n", ans1, ans2);
	
	return (0);
}

C++: #include <cstdio>
#include <algorithm>
#include <functional>

using namespace std;

int main(void) {
	int univ[2];
	for(int i = 0; i < 2; i++) {
		int score[10];
		for(int j = 0; j < 10; j++)
			scanf("%d", &score[j]);
		sort(score, score + 10, greater<int>());
		univ[i] = score[0] + score[1] + score[2];
	}
	printf("%d %d\n", univ[0], univ[1]);
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
int a,b,c,d,e,f,i,g;
a=0;
b=0;
c=0;
d=0;
e=0;
f=0;
for (i=1;i<=10;i++){
    cin>>g;
    if(a<=g){
        c=b;
        b=a;
        a=g;
    }else if(b<=g){
        c=b;
        b=g;
    }else if(c<=g){
        c=g;
    }
}
for (i=1;i<=10;i++){
    cin>>g;
    if(d<=g){
        f=e;
        e=d;
        d=g;
    }else if(e<=g){
        f=e;
        e=g;
    }else if(f<=g){
        f=g;
    }
}
cout<<a+b+c<<" "<<d+e+f<<endl;
}

C++: //https://onlinejudge.u-aizu.ac.jp/challenges/sources/JOI/Prelim/0533?year=2009

#include <bits/stdc++.h>

using namespace std;

int main() {
    vector<int> a(10);
    for (int i = 0; i < 10; ++i) {
        cin >> a[i];
    }
    sort(a.begin(), a.end(), greater<>());
    int ans1 = accumulate(a.begin(), a.begin() + 3, 0);

    vector<int> b(10);
    for (int i = 0; i < 10; ++i) {
        cin >> b[i];
    }
    sort(b.begin(), b.end(), greater<>());
    int ans2 = accumulate(b.begin(), b.begin() + 3, 0);

    cout << ans1 << " " << ans2 << endl;
    return 0;
}

/*
 *
 */

C++: #include<stdio.h>
int main()
{
	int i,a,w1=0,w2=0,w3=0,k1=0,k2=0,k3=0;
	for(i=0;i<10;i++){
		scanf("%d",&a);
		if(w3<a){
			w3=a;
			if(w2<a){
				w3=w2;
				w2=a;
				if(w1<a){
					w2=w1;
					w1=a;
				}
			}
		}
	}
	for(i=0;i<10;i++){
		scanf("%d",&a);
		if(k3<a){
			k3=a;
			if(k2<a){
				k3=k2;
				k2=a;
				if(k1<a){
					k2=k1;
					k1=a;
				}
			}
		}
	}
	printf("%d %d\n",w1+w2+w3,k1+k2+k3);
	return 0;
}

C++: #include "bits/stdc++.h"

// Begin {{{
using namespace std;
#define all(x) x.begin(), x.end()
#define rep(i, n) for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, b, e) for (i64 i = (b), i##_limit = (e); i <= i##_limit; ++i)
#define repr(i, b, e) for (i64 i = (b), i##_limit = (e); i >= i##_limit; --i)
#define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__)
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T> using MaxHeap = priority_queue<T>;
template <class T> using MinHeap = priority_queue<T, vector<T>, greater<>>;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
inline i64 sigma(i64 n) { return n * (1 + n) >> 1; }
inline i64 updiv(i64 n, i64 d) { return (n + d - 1) / d; }
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;
#ifndef DEBUG
#define dump(...)
#endif

inline void input() {}
template <class Head, class... Tail>
inline void input(Head&& head, Tail&&... tail) {
    cin >> head;
    input(forward<Tail>(tail)...);
}

inline void outs() { cout << "\n"; }
template <class Head, class... Tail>
inline void outs(Head&& head, Tail&&... tail) {
    cout << head << (sizeof...(tail) ? " " : "");
    outs(forward<Tail>(tail)...);
}

template <class T>
inline void outs(vector<T> &vec) { for (auto &e : vec) cout << e << " \n"[&e == &vec.back()]; }

template <class T>
inline void outs(vector<vector<T>> &df) { for (auto &vec : df) outs(vec); }

inline void outl() { cout << "\n"; }
template <class Head, class... Tail>
inline void outl(Head&& head, Tail&&... tail) {
    cout << head << (sizeof...(tail) ? "\n" : "");
    outl(forward<Tail>(tail)...);
}

template <class T>
inline void outl(vector<T> &vec) { for (auto &e : vec) cout << e << "\n"; }

inline void outn() {}
template <class Head, class... Tail>
inline void outn(Head&& head, Tail&&... tail) {
    cout << head;
    outn(forward<Tail>(tail)...);
}

template <class T>
inline void outn(vector<T> &vec) { for (auto &e : vec) cout << e; }

template <class T>
inline vector<T> make_v(const T &initvalue, size_t sz) {
    return vector<T>(sz, initvalue);
}

template <class T, class... Args>
inline auto make_v(const T &initvalue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initvalue, args...))>(sz, make_v<T>(initvalue, args...));
}
// }}} End

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    vector<int> w(20), k(20);
    rep(i, 10) input(w[i]);
    rep(i, 10) input(k[i]);
    sort(all(w), greater<>());
    sort(all(k), greater<>());
    outs(w[0] + w[1] + w[2], k[0] + k[1] + k[2]);
    return 0;
}

C++: #include <stdio.h>

int main(){
	int a=0,b=0,c=0,s;
	int i,j;
	for(i=0,i<10,i++){
		scanf("%d \n",&s);
		if(s>a){
			c=b;
			b=a;
			a=s;
		}
		else if(s>b){
			c=b;
			b=s;
		}
		else if(s>c){
			c = s;
		}
	}
	printf("%d ",a+b+c);
	a=0; b=0; c=0;
	for(i=0,i<10,i++){
		scanf("%d \n",&s);
		if(s>a){
			c=b;
			b=a;
			a=s;
		}
		else if(s>b){
			c=b;
			b=s;
		}
		else if(s>c){
			c = s;
		}
	}
	printf("%d\n",a+b+c);
	return 0;
}