Go: package main

import "fmt"

func main() {
	var height int
	topHeights := [5]int{}

	for i := 0; i < 10; i++ {
		fmt.Scan(&height)

		for j := 0; j < 3; j++ {
			if topHeights[j] < height {
				topHeights[j+2] = topHeights[j+1]
				topHeights[j+1] = topHeights[j]
				topHeights[j] = height
				break
			}
		}
	}

	for i := 0; i < 3; i++ {
		fmt.Println(topHeights[i])
	}
}

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

int i,j,a[12];

int comp(const void *p,const void *q){
	return *(int *)q-*(int *)p;
}

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

C++: #include<iostream>

using namespace std;

int main(){
    int a[10];
    for(int i=0;i<10;i++)cin>>a[i];
    
    int x=-1,y=-1,z=-1;
    for(int i=0;i<10;i++){
        if(a[i]>x){
            z=y;
            y=x;
            x=a[i];
        }else if(a[i]>y){
            z=y;
            y=a[i];
        }else if(a[i]>z){
            z=a[i];
        }
    }
    cout<<x<<endl<<y<<endl<<z<<endl;
    
    return 0;
}

C++: #include <stdio.h>
int main(void)
{
	int n,m[10],l,s;
	for(n=0;n<10;n++)
	{
		scanf("%d",&m[n]);
	}
	for(n=0;n<10;n++)
	{
		for(l=n+1;l<10;l++)
		{
			if(m[n]<m[l])
			{
				s=m[n];
				m[n]=m[l];
				m[l]=s;
			}
		}
	}
	printf("%d\n%d\n%d\n",m[0],m[1],m[2]);
	return 0;
}

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

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

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, [](const int& x, const int& y) {return x > y;});
  for (int i=0; i<3; i++) {
    cout << a[i] << endl;
  }
}

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

vector <int> v;
int hom;

int main(){
        while(cin >> hom){
                v.push_back(hom);
        }
        sort(v.begin(), v.end() );
        for(int i=v.size()-1;i>v.size()-4;i--){
                cout << v[i] << endl;
        }
}

C++: #include<iostream>
using namespace std;
int main() {
	int x, a, b, c;
	a = 0;
	b = 0;
	c = 0;
	for (int i = 0; i <= 9; i++) {
		cin >> x;
		if (a <= x) {
			c = b;
			b = a;
			a = x;
			goto a;
		}
		if (b <= x) {
			c = b;
			b = x;
			goto a;
		}
		if (c <= x) {
			c = x;
			goto a;
		}
	a:;
	}
	cout << a << endl;
	cout << b << endl;
	cout << c << endl;
}

C++: #include<iostream>
using namespace std;
int main() {
	int a[10],box,i, j;
	for (i = 0; i < 10; i++) {
		cin >> a[i];
	}
	for (i = 0; i < 9; i++) {
		for (j = i + 1; j < 10; j++) {
			if (a[i] < a[j]) {
				box = a[i];
				a[i] = a[j];
				a[j] = box;
			}
		}
	}for (i = 0; i < 3; i++){
		cout << a[i] << endl;
	}
	return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed 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() {
  int W, H;
  while (cin >> W >> H, W) {
    vs v(H);
    rep(i, H) cin >> v[i];
    vvi dp(H, vi(W));
    int b = 0, w = 0;
    rep(i, H) rep(j, W) {
      dp[i][j] = 2 * (v[i][j] == 'B') + (v[i][j] == 'W');
      b -= v[i][j] == 'B';
      w -= v[i][j] == 'W';
    }
    rep(_, W * H) rep(i, H) rep(j, W) {
      if (v[i][j] != '.') continue;
      if (i > 0) dp[i][j] |= dp[i - 1][j];
      if (j > 0) dp[i][j] |= dp[i][j - 1];
      if (i < H - 1) dp[i][j] |= dp[i + 1][j];
      if (j < W - 1) dp[i][j] |= dp[i][j + 1];
    }
    rep(i, H) rep(j, W) {
      b += dp[i][j] == 2;
      w += dp[i][j] == 1;
    }
    cout << b << ' ' << w << endl;
  }
}

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

int main(){
	int i;
	int temp[10];

	for(i=0;i<10;i++){
		cin >> temp[i];
	}

	sort(temp, temp+10, greater<int>());

	for(i=0;i<3;i++){
		cout << temp[i] << endl;
	}
	

	return 0;
}

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

int main(){

  std::vector<unsigned int> heights;

  char buf[100];
  for (int i=0; i<10 ; i++){
    std::cin >> buf;
    heights.push_back(atoi(buf));
  }

  std::sort(heights.begin(),heights.end(),std::greater<int>());

  for (int i=0; i<3;i++){
    std::cout << heights[i] << std::endl;
  }

  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {

	int height[10];

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

	for (int i = 10 - 1; i >= 0; i--) {
		for (int j = 0; j < i; j++) {
			if (height[j] > height[j + 1]) {
				int dummy = height[j];
				height[j] = height[j + 1];
				height[j + 1] = dummy;
			}
		}
	}

	for (int i = 9; i >= 7; i--) {
		cout << height[i] << endl;
	}

	return 0;

}

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

typedef long long ll;

int main(void)
{
    priority_queue<ll> pque;
    ll input;

    for (int i = 0; i < 10; i++) {
        cin >> input;
        pque.push(input);
    }

    for (int i = 0; i < 3; i++) {
        cout << pque.top() << endl;
        pque.pop();
    }

    return 0;
}

C++: #include <iostream>

const int N = 10;

int main(void) {
  int a[N] = {0};

  for (int i = 0; i < N; i++) {
    std::cin >> a[i];
  }

  int three = 3;

  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      if (a[j] > a[i]) {
	int tmp = a[i];
	a[i] = a[j];
	a[j] = tmp;
      }
    }
  }

  for (int i = 0; i < three; i++) {
    std::cout << a[i] << std::endl;
  }
   
  return 0;
}

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

using namespace std;

int main(void){
  int h;
  vector<int>hill;

  for(int i=0;i<10;i++){
    cin >> h;
    hill.push_back(h);
  }

  sort(hill.begin(),hill.end(),greater<int>());

  for(int i=0;i<3;i++)
    cout << hill[i] << endl;

  return 0;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
int main(void){
    // Here your code !
    int a[10];
    for(int i = 0; i<10; i++){
        scanf("%d\n", &(a[i]));
    }
    
    sort(a,a+10);
    printf("%d\n%d\n%d\n", a[9],a[8],a[7]);
}