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<algorithm>

using namespace std;


int a[10], b[10];

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

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

C++: #include<bits/stdc++.h>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;

int main(){
	int w[10],k[10];
	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);
	printf("%d ",w[7]+w[8]+w[9]);
	printf("%d\n",k[7]+k[8]+k[9]);
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;

void solve()
{
	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(), greater<int>() );
	sort(K.begin(), K.end(), greater<int>() );
	int sumW = 0;
	int sumK = 0;
	for(int i = 0; i < 3; ++i)
	{
		sumW += W[i];
		sumK += K[i];
	}
	cout << sumW << " " << sumK << endl;
}

int main()
{
	solve();
	return(0);
}

C++: // だーれだ？
//qqqqqqHHMqqqqqHf!(:;jHmmkf``(:;jkqqqqqqqqqmMH#HMqqK_````````````````(kqqqqqqHMMM
//qqqqqqHHmqqqqH=` :;;jkqH=?~..;;jqqqqqqqqqmM#HM#MHH!```` ```````..-``dqWbWkRqHMMM
//qqqqqqMHmqqqK!``.;;;dqH: ```.?TUqqHmqqqqmHHHM4Mqkt..```` ..JgHHW@P`.HHkqHHHqM#NN
//qqqqqmHMmqHTYWHgHmmgHR...``` :;Jkq9qqqqqgMH#1dHk$...-gW@HY"=!``dH! dHNmqqqqmM###
//qqqqqqgMmH[````` ?dHMMMHHHHHJ<;JkK>XqqqmMH#<+Hb%.WYYTHppf-````.gt`.HHMmmqqqmM###
//qqkqqqm@H?S,```` Jpbbpp:```` :!dK<;JkqqMMY(;dW^````.ppbpf!```.Y<`.HHHMgmqqqmH###
//qqqqqqqqD`` ````(ppbppW````` ~.f`:;jkqM#^.;jf!````.Wppbpf````````(HH#HmmqqmH#NN#
//qqqqqqqkP``````.fpbpbpf``` ` `.``~:;WHY``(+=``````Jppbpf\```` ``.MH#HHgqqqmHNNNN
//qqqqqqqk]```` `,fpbbpf>```` `` ``_:<? ``.?!``` `` Wpppp%``` ``` dHH##HmmqqmH####
//qqqqqqqk]``````,fpbppt``` `` `` `_~````` `` `` ```WppW=``` ````.HHHHMHmmqqmM####
//qqqqqqqk$`` ````4ppfY```` `` `` `- `` `` `` ``` ``(T=`````` ``.MH##HMMmmqqmM##HH
//qqqqqqHqP``` ````?7!```` `` `` ``` `` ` ` ``  ````````` ` ````.MHH#HgMmqmqmHHHHH
//qqqkqqmkR```` `        `` ` `` ` ` ` ``` ` ``` `   ......_. ```dH#HHgMqqgqqmH#HH
//NqqqqqHqR```  _ ........_` `` ``` ``` ````` ``` ............```,HHHHmqqqHqqmMH##
//MmqqqqHqR```  _........_ `` `` ``` `` `  `` ` ` `  `__     ` ``,HHHMmmqqMHmmMHH#
//HMqqqqXkH `````````````` ` `` `  `` `` `` `` `` ```` ````` ````.HHHMmMHm@HHqmMHH
//HHHmqqfHk;``` `  ` `` ` ` `` ``` ` ` ``` `` `` `` ````  `..```.HHHHMMHMg@HHHHHMH
//HHMmmqMHkP<.`` ``` ` ` ``` `` ``` ``` ` `` `` `` `  ````  ```.MH##HM#HMg@@@@H@HH
//##HNmqR`jW<<_ ``` ````` `` ` ` ``` `` `` `` `` ````  ````` .dHH##H#HHHMHH@@H@@@@
//HH##NqH..X2:<<-.`` ` `` ``` ``` ` `` `` `` ` `` ` ``` ` .gMHHH#H#HHH#HM@@H@@H@@H
//-WHHHNH[ =v._:::<-. ` `` ` ``  ```````.`` `````````     .MHH###H#MHHHHH@H@H@@HH@
//` 7MHHMH.l==.  ~:::::<_-.. ````` ``````` ``  ...uX;     `,MHHHH#M@@MM@@@@@@H@@@@
//  . TMHHbZl=1.   _~::::::(<::<:<___-___:<<:::::jX3=. ` ` `,MMHM@@@@Mg@@@@@@@@@H@
//
#include <bits/stdc++.h>
#define int long long
#define ll long long 
#define rep(i,a,b) for(signed i=a;i<(b);++i)
#define erep(i,a,b) for(signed i=a;i<=(b);++i)
#define per(i,a,b) for(signed i=(a);i>(b);--i)
#define eper(i,a,b) for(signed i=(a);i>=b;--i)
#define fore(i, x, a) for(auto &&x:a) 
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define pb push_back
#define mp make_pair
#define ALL(x) begin(x),end(x)
#define F first
#define S second
#define debug(x)  cout << #x << ": " << (x) << '\n';
const long long INF=1001001001001001001;
const int MOD=(int)1e9 + 7;
const double EPS=1e-9;
using namespace std;
using Pii = pair<int,int>;
using vii = vector<int>;
template<class T>using  PS_queue = priority_queue<T, vector<T>, greater<T> >;
template<class T>using vv = vector<T>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){fill( (T*)array, (T*)(array+N), val );}
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v))os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T>T gcd(T a, T b){ return b ? gcd(b, a % b) : a; }
template<class T>T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct edge { int from, to, cost; };
int dy[]={0, 1, -1, 0}; int dx[]={1, 0, 0, -1};
// cout << fixed;
// cout << setprecision(10) << val;

signed main() {
 cin.tie(0);
 ios::sync_with_stdio(false);
  vii A(10), B(10);
  rep(i, 0, 10) cin >> A[i];
  rep(i, 0, 10) cin >> B[i];
  sort(ALL(A), greater<int>());
  sort(ALL(B), greater<int>());
  cout << A[0] + A[1] + A[2] << " " << B[0] + B[1] + B[2] << endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int big[3];
    for(int i=0;i<3;i++)big[i]=0;
    for(int i=0;i<10;i++){
        int a;
        cin>>a;
        if(a>big[0]){
            big[2]=big[1];
            big[1]=big[0];
            big[0]=a;
        }
        else if(a>big[1]){
            big[2]=big[0];
            big[0]=a;
        }
        else if(a>big[2])big[2]=a;
    }
    int W=big[0]+big[1]+big[2];

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

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

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int ws=0,ks=0;
	int data;
	rep(i,10){cin>>data;ws+=data;}
	rep(i,10){cin>>data;ks+=data;}
	cout<< ws << " " <<ks << endl;
}

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

int main(){
  int a[10];

  for(int i=0;i<10;i++){
    cin >> a[i];
  }
  sort(a,a+10,greater<int>());
  cout << a[0]+a[1]+a[2] << " ";

  for(int i=0;i<10;i++){
    cin >> a[i];
  }
  sort(a,a+10,greater<int>());
  cout << a[0]+a[1]+a[2] << endl;
}

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

using pii = pair<int, int>;
using vi = vector<int>;
using ll = long long;

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(rbegin(W), rend(W));
    sort(rbegin(K), rend(K));
    cout << W[0] + W[1] + W[2] << ' ' << K[0] + K[1] + K[2] << endl;
}