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 main()
{
    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, w + 10);
    sort(k, k + 10);
    cout << w[9] + w[8] + w[7] << " " << k[9] + k[8] + k[7] << endl;
}

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<<endl;		  
		return 0;
}

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

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
  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,w+10);
  sort(k,k+10);

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

}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <bitset>
#include <fstream>
#include <cmath>
#include <ctime>
using namespace std;
typedef long long ll;

int main()
{
	vector<int> p;
	for(int i = 0; i < 2; i++){
		priority_queue<int> point;
		for(int j = 0; j < 10; j++){
			int buf;
			cin>>buf;
			point.push(buf);
		}
		int res = 0;
		for(int j = 0; j < 3; j++){
			res += point.top();
			point.pop();
		}
		p.push_back(res);
	}
	cout << p[0] << " " << p[1] <<endl;
}

C++: #include<stdio.h>
int main(){
  int a[10],b[10],i,c[2],j,st;
  for(i=0;i<10;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<10;i++){
    scanf("%d",&b[i]);
  }
  for(i=0;i<10;i++){
    for(j=1;j<10;j++){
      if(a[j-1]<a[j]){
	st=a[j];
	a[j]=a[j-1];
	a[j-1]=st;
      }
      if(b[j-1]<b[j]){
	st=b[j];
	b[j]=b[j-1];
	b[j-1]=st;
      }
    }
  }
  c[0]=0;
  c[1]=0;
  for(i=0;i<3;i++){
    c[0]+=a[i];
    c[1]+=b[i];
  }
  printf("%d %d\n",c[0],c[1]);
  return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<algorithm>

using namespace std;

int main(void)
{
  int W[10];
  int K[10];
  int Wpon, Kpon;
  int i;

  memset(W,0,sizeof(W));
  memset(K,0,sizeof(K));

  for (i = 0;i <= 20;i++){
    if (i < 10){
      scanf("%d", &W[i]);
    }
    else if (i > 10){
      scanf("%d", &K[i-9]);
    }
  }

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

  Wpon = W[9] + W[8] + W[7];
  Kpon = K[9] + K[8] + K[7];

  printf("%d %d\n", Wpon, Kpon);

  return 0;
}

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;j>i;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 <iostream>
#include <queue>
#include <vector>
#include <limits>
#include <cstring>

#define FOR(i,b,n) for(int i=b;i<n; i++)
#define CLR(mat) memset(mat, 0, sizeof(mat))

using namespace std;

int asum = 0, bsum = 0;

void solve()
{
	int a;
	
	FOR(i, 0 ,20)
	{
		cin >> a;
		
		if( i >= 10 )
			bsum += a;
		else
			asum += a;
			
	}

	return;
}

int main()
{
	solve();
	
	cout << asum << " " << bsum << endl;
	
	return 0;
}

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

int main() {
	for (;;){
		int a[10];
		int b[10];
		for (int i = 0; i < 10; i++){
			cin >> a[i];
		}
		if (cin.eof()) break;
		sort(a, a + 10);
		cout << a[9] + a[8] << " ";
		for (int i = 0; i < 10; i++){
			cin >> b[i];
		}
		sort(b, b + 10);
		cout << b[9] + b[8] << endl;
	}
}

C++: #include<algorithm>
#include<cstdio>
#define s(A) std::sort(A,A+10);
main(){
int W[10],K[10],Z[20],p;
for(int i=0;i<20;i++)
scanf("%d",&p),Z[i]=p;
s(Z);
s(Z+10);
printf("%d %d\n",Z[7]+Z[8]+Z[9],Z[17]+Z[18]+Z[19]);
return 0;
}

C++: #include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-10;
const vi emp;

vector<ll> a(20);

int main(){
	for(auto i=a.begin();i!=a.end();i++) cin>>*i;
	sort(a.begin(),a.begin()+10);
	sort(a.begin()+10,a.end());
	cout<<a[7]+a[8]+a[9]<<endl<<a[17]+a[18]+a[19]<<endl;
}

C++: #include<stdio.h>
int main(void)
{
	int data[10];
	int dai1,dai2,wk;
	int i,j;
	for(i=0;i<10;i++){
		scanf("%d",&data[i]);
	}
	for(i=0;i<9;i++){
		for(j=i+1;j<10;j++){
			if(data[i]<data[j]){
				wk=data[i];
				data[i]=data[j];
				data[j]=wk;
			}
		}
	}
	dai1=data[0]+data[1]+data[2];
	for(j=0;j<10;j++){
		scanf("%d",&data[j]);
	}
	for(j=0;j<9;j++){
		for(i=j+1;i<10;i++){
			if(data[j]<data[i]){
				wk=data[j];
				data[j]=data[i];
				data[i]=wk;
			}
		}
	}
	dai2=data[0]+data[1]+data[2];
	printf("%d %d\n",dai1,dai2);
	return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  vi a(10), b(10);
  rep(i, 10) cin >> a[i];
  rep(i, 10) cin >> b[i];
  sort(rall(a)), sort(rall(b));
  cout << a[0] + a[1] + a[2] << ' ' << b[0] + b[1] + b[2] << endl;
}