#include<iostream>
#include<functional>
#include<cassert>
#include<stack>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<queue>
#include<map>
#include<stdio.h>
#include<list>
#include<cmath>
#define clm(m,v,Arr) for(ll i=0;i<m;i++) Arr[i] = v
#define Fast ios::sync_with_stdio(0);
#define Frn(i,n) for(ll i =0 ;i<n;i++)
typedef long long ll;
using namespace std;
const double Eps = 1e-9;
int Mod = 1000000000 + 7;
int n, m, q, k;
//char Arr[20001];
int Arr[100010];
bool prime[10010];
//int Acc[1000000];
bool ok = true;
void sieve() {
	for (int i = 2; i*i <= 1e4; i++) {
		if(prime[i] == true)
		for (int j = i * 2; j <= 1e4; j++) {
			prime[j] = false;
		}
	}
}
double a, b, c;
double prob[10000];

double dp[102][102][102];
int vis[102][102][102];
int gr(int number) {
	return number*(number - 1) / 2;
}
double Solve( int rock, int scisors, int paper) {
	if (rock == 0) {
		return 0;
	}
	if (paper + scisors == 0)
		return 1;
	double C0 = gr(rock + scisors + paper);
	double C1 = gr(rock) + gr(scisors) + gr(paper);
	C1 /= C0;
	C1 = 1 - C1;
	//double ret = 0;
	double &ret = dp[rock][scisors][paper];
	if (vis[rock][scisors][paper] != -1) return dp[rock][scisors][paper];
	vis[rock][scisors][paper] = 1;
	if (rock > 0 && scisors > 0) {
		ret += Solve(rock, scisors - 1, paper)*double((rock*scisors) / C0);
	}
	if (rock > 0 && paper > 0) {
		ret += Solve(rock - 1, scisors, paper)*double((rock*paper) / C0);
	}
	if (scisors > 0 && paper > 0) {
		ret += Solve(rock, scisors, paper - 1)*double((paper*scisors) / C0);
	}
	if (C1) ret /= C1;
	return ret;
}
int cnt;
int main()
{

	Fast;
	memset(vis, -1, sizeof(vis));
	/*for (int i = 0; i <= 1e4; i++)
		dp[i] = -1e7;*/
//	sieve();
	cin >> a >> b >> c;
	cout << fixed;
	printf("%.10lf\n", Solve(a, b, c));
	printf("%.10lf\n", Solve(b, c, a));
	printf("%.10lf\n", Solve(c, a, b));

}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <malloc.h>
#include <ctype.h>
#include <math.h>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#include <stack>
#include <queue>
#include <vector>
#include <deque>
#include <set>
#include <map>
#define INF 999999999
#define eps 0.00001
#define LL __int64d
#define pi acos(-1.0)

double dp[110][110][110];
int main()
{
	int shi,jian,bu;
	while(scanf("%d%d%d",&shi,&jian,&bu)!=EOF)
	{
		memset(dp,0,sizeof dp);
		dp[shi][jian][bu]=1;
		for(int i=shi;i>=0;i--)
		{
			for(int j=jian;j>=0;j--)
			{
				for(int k=bu;k>=0;k--)
				{
					//printf("%d %d %d %lf\n ",i,j,k,dp[i][j][k]);

					if(i+j==0||i+k==0||j+k==0)
						continue;

					double tem=0;
					if(k!=0)
						tem+=1.0*j*k/(i+j+k)/(i+j+k-1);
					if(j!=0)
						tem+=1.0*j*i/(i+j+k)/(i+j+k-1);
					if(i!=0)
						tem+=1.0*i*k/(i+j+k)/(i+j+k-1);

					if(k!=0)
					dp[i][j][k-1]+=dp[i][j][k]*j*k/(i+j+k)/(i+j+k-1)/tem;
					if(j!=0)
					dp[i][j-1][k]+=dp[i][j][k]*j*i/(i+j+k)/(i+j+k-1)/tem;
					if(i!=0)
					dp[i-1][j][k]+=dp[i][j][k]*i*k/(i+j+k)/(i+j+k-1)/tem;
				}
			}
		}
		double aj=0;
		double as=0,ab=0;
		for(int i=1;i<=jian;i++)
		{
			aj+=dp[0][i][0];
		}
		for(int i=1;i<=shi;i++)
		{
			as+=dp[i][0][0];
		}
		for(int i=1;i<=bu;i++)
		{
			ab+=dp[0][0][i];
		}
		printf("%f %f %f\n",as,aj,ab);

	}
	return 0;
}
/*
int dir[4][2]={1,0,-1,0,0,1,0,-1};
char mp[510][510];
int n,m;
int ex,ey;
int flag;

int ok(int x,int y)
{
	if(x<1||x>n||y<1||y>m)
		return 0;
	return 1;
}

void dfs(int x,int y)
{
	if(flag)
		return;
	for(int i=0;i<4;i++)
	{
		int xx=x+dir[i][0];
		int yy=y+dir[i][1];
		if(!ok(xx,yy))
			continue;
		if(mp[xx][yy]=='X')
		{
			if(xx==ex&&yy==ey)
				flag=1;
			continue;
		}

		mp[xx][yy]='X';
		dfs(xx,yy);
		mp[xx][yy]='.';
	}
}
int main()
{
	int sx,sy;
	while(scanf("%d%d",&n,&m)!=EOF)
	{
		for(int i=1;i<=n;i++)
			scanf("%s",mp[i]+1);

		scanf("%d%d",&sx,&sy);
		scanf("%d%d",&ex,&ey);
		flag=0;
		dfs(sx,sy);
		if(flag)
			puts("YES");
		else
			puts("NO");

	}
	return 0;
}*/

/*
4 6
X...XX
...XX.
.X..X.
......
1 6
2 2
*/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <malloc.h>
#include <ctype.h>
#include <math.h>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#include <stack>
#include <queue>
#include <vector>
#include <deque>
#include <set>
#include <map>
#define INF 999999999
#define eps 0.00001
#define LL __int64d
#define pi acos(-1.0)

double dp[110][110][110];
int main()
{
	int shi,jian,bu;
	while(scanf("%d%d%d",&shi,&jian,&bu)!=EOF)
	{
		memset(dp,0,sizeof dp);
		dp[shi][jian][bu]=1;
		for(int i=shi;i>=0;i--)
		{
			for(int j=jian;j>=0;j--)
			{
				for(int k=bu;k>=0;k--)
				{
					//printf("%d %d %d %lf\n ",i,j,k,dp[i][j][k]);

					if(i+j==0||i+k==0||j+k==0)
						continue;

					double tem=0;
					if(k!=0)
						tem+=1.0*j*k/(i+j+k)/(i+j+k-1);
					if(j!=0)
						tem+=1.0*j*i/(i+j+k)/(i+j+k-1);
					if(i!=0)
						tem+=1.0*i*k/(i+j+k)/(i+j+k-1);

					if(k!=0)
					dp[i][j][k-1]+=dp[i][j][k]*j*k/(i+j+k)/(i+j+k-1)/tem;
					if(j!=0)
					dp[i][j-1][k]+=dp[i][j][k]*j*i/(i+j+k)/(i+j+k-1)/tem;
					if(i!=0)
					dp[i-1][j][k]+=dp[i][j][k]*i*k/(i+j+k)/(i+j+k-1)/tem;
				}
			}
		}
		double aj=0;
		double as=0,ab=0;
		for(int i=1;i<=jian;i++)
		{
			aj+=dp[0][i][0];
		}
		for(int i=1;i<=shi;i++)
		{
			as+=dp[i][0][0];
		}
		for(int i=1;i<=bu;i++)
		{
			ab+=dp[0][0][i];
		}
		printf("%lf %lf %lf\n",as,aj,ab);

	}
	return 0;
}
/*
int dir[4][2]={1,0,-1,0,0,1,0,-1};
char mp[510][510];
int n,m;
int ex,ey;
int flag;

int ok(int x,int y)
{
	if(x<1||x>n||y<1||y>m)
		return 0;
	return 1;
}

void dfs(int x,int y)
{
	if(flag)
		return;
	for(int i=0;i<4;i++)
	{
		int xx=x+dir[i][0];
		int yy=y+dir[i][1];
		if(!ok(xx,yy))
			continue;
		if(mp[xx][yy]=='X')
		{
			if(xx==ex&&yy==ey)
				flag=1;
			continue;
		}

		mp[xx][yy]='X';
		dfs(xx,yy);
		mp[xx][yy]='.';
	}
}
int main()
{
	int sx,sy;
	while(scanf("%d%d",&n,&m)!=EOF)
	{
		for(int i=1;i<=n;i++)
			scanf("%s",mp[i]+1);

		scanf("%d%d",&sx,&sy);
		scanf("%d%d",&ex,&ey);
		flag=0;
		dfs(sx,sy);
		if(flag)
			puts("YES");
		else
			puts("NO");

	}
	return 0;
}*/

/*
4 6
X...XX
...XX.
.X..X.
......
1 6
2 2
*/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <malloc.h>
#include <ctype.h>
#include <math.h>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#include <stack>
#include <queue>
#include <vector>
#include <deque>
#include <set>
#include <map>
#define INF 999999999
#define eps 0.00001
#define LL __int64d
#define pi acos(-1.0)

double dp[110][110][110];
int main()
{
	int shi,jian,bu;
	while(scanf("%d%d%d",&shi,&jian,&bu)!=EOF)
	{
		memset(dp,0,sizeof dp);
		dp[shi][jian][bu]=1;
		for(int i=shi;i>=0;i--)
		{
			for(int j=jian;j>=0;j--)
			{
				for(int k=bu;k>=0;k--)
				{
					//printf("%d %d %d %lf\n ",i,j,k,dp[i][j][k]);

					if(i+j==0||i+k==0||j+k==0)
						continue;

					double tem=0;
					if(k!=0)
						tem+=1.0*j*k/(i+j+k)/(i+j+k-1);
					if(j!=0)
						tem+=1.0*j*i/(i+j+k)/(i+j+k-1);
					if(i!=0)
						tem+=1.0*i*k/(i+j+k)/(i+j+k-1);

					if(k!=0)
					dp[i][j][k-1]+=dp[i][j][k]*j*k/(i+j+k)/(i+j+k-1)/tem;
					if(j!=0)
					dp[i][j-1][k]+=dp[i][j][k]*j*i/(i+j+k)/(i+j+k-1)/tem;
					if(i!=0)
					dp[i-1][j][k]+=dp[i][j][k]*i*k/(i+j+k)/(i+j+k-1)/tem;
				}
			}
		}
		double aj=0;
		double as=0,ab=0;
		for(int i=1;i<=jian;i++)
		{
			aj+=dp[0][i][0];
		}
		for(int i=1;i<=shi;i++)
		{
			as+=dp[i][0][0];
		}
		for(int i=1;i<=bu;i++)
		{
			ab+=dp[0][0][i];
		}
		printf("%.9lf %.9lf %.9lf\n",as,aj,ab);

	}
	return 0;
}
/*
int dir[4][2]={1,0,-1,0,0,1,0,-1};
char mp[510][510];
int n,m;
int ex,ey;
int flag;

int ok(int x,int y)
{
	if(x<1||x>n||y<1||y>m)
		return 0;
	return 1;
}

void dfs(int x,int y)
{
	if(flag)
		return;
	for(int i=0;i<4;i++)
	{
		int xx=x+dir[i][0];
		int yy=y+dir[i][1];
		if(!ok(xx,yy))
			continue;
		if(mp[xx][yy]=='X')
		{
			if(xx==ex&&yy==ey)
				flag=1;
			continue;
		}

		mp[xx][yy]='X';
		dfs(xx,yy);
		mp[xx][yy]='.';
	}
}
int main()
{
	int sx,sy;
	while(scanf("%d%d",&n,&m)!=EOF)
	{
		for(int i=1;i<=n;i++)
			scanf("%s",mp[i]+1);

		scanf("%d%d",&sx,&sy);
		scanf("%d%d",&ex,&ey);
		flag=0;
		dfs(sx,sy);
		if(flag)
			puts("YES");
		else
			puts("NO");

	}
	return 0;
}*/

/*
4 6
X...XX
...XX.
.X..X.
......
1 6
2 2
*/


#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>
#include <set>
#include <string>
#include <queue>

using namespace std;

const int maxn = 105;

int r, s, p;

double d[maxn][maxn][maxn];

double make_v(int a, int b, int c, int t) {
  if (a * b + b * c + c * a == 0) {
    return (double) 0;
  }

  if (t == 0) {
    return (double) (c * a) / (a * b + b * c + c * a);
  } else if (t == 1) {
    return (double) (a * b) / (a * b + b * c + c * a);
  } else if (t == 2) {
    return (double) (b * c) / (a * b + b * c + a * c);
  }
}

double f(int a, int b, int c) {

  if (a > r || b > s || c > p) {
    return (double) 0;
  }

  if (d[a][b][c] == (double) -1) {
    if (a == r && b == s && c == p) {
      return d[a][b][c] = (double) 1;
    }

    d[a][b][c] = (double) 0;

    if (make_v(a + 1, b, c, 0) != (double) 0) {
      d[a][b][c] += make_v(a + 1, b, c, 0) * f(a + 1, b, c);
    }

    if (make_v(a, b + 1, c, 1) != (double) 0) {
      d[a][b][c] += make_v(a, b + 1, c, 1) * f(a, b + 1, c);
    }

    if (make_v(a, b, c + 1, 2) != (double) 0) {
      d[a][b][c] += make_v(a, b, c + 1, 2) * f(a, b, c + 1);
    }
  }

  return d[a][b][c];
}

void clear() {
  for (int i = 0; i < maxn; i++) {
    for (int j = 0; j < maxn; j++) {
      for (int k = 0; k < maxn; k++) {
        d[i][j][k] = (double) -1;
      }
    }
  }
}

int main() {
  scanf("%d %d %d", &r, &s, &p);

  double vr = 0.0;
  double sr = 0.0;
  double pr = 0.0;

  clear();

  for (int i = 1; i <= r; i++) {
    vr += f(i, 0, 0);
  }

  clear();

  for (int i = 1; i <= s; i++) {
    sr += f(0, i, 0);
  }

  clear();

  for (int i = 1; i <= p; i++) {
    pr += f(0, 0, i);
  }

  printf("%.12lf %.12lf %.12lf", vr, sr, pr);

  return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

#define Rock 1
#define Scissor 2
#define Paper 3

double dRSP[101][101][101][4] = {0,};

vector<double> Probability(vector<int> RSP)
{
    vector<double> Pro;
    Pro.resize(4);
    double Pro_Sum = 0;
    int Sum = 0;
    for(int i=1; i<=3; i++)
        Sum += RSP[i];

    for(int i=1; i<=3; i++)
    {
        Pro[i] = 2*RSP[i-1]*RSP[i];
        Pro[i] /= Sum*(Sum-1);
        Pro_Sum += Pro[i];
    }

    Pro[0] = Pro[Paper];

    for(int i=0; i<=3; i++)
        Pro[i] *= 1/Pro_Sum;

    return Pro;
}

int main()
{
    int RSP[4], Sum=0;
    for(int i=1; i<=3; i++)
    {
        cin >> RSP[i];
        Sum += RSP[i];
    }
    RSP[0] = RSP[Paper];

    for(int i=1; i<=Sum; i++)
    {
        dRSP[0][0][i][0] = 1;
        dRSP[i][0][0][Rock] = 1;
        dRSP[0][i][0][Scissor] = 1;
        dRSP[0][0][i][Paper] = 1;

        for(int R=0; R<=i&&R<=RSP[Rock]; R++)
        {
            for(int S=0; S<=i-R&&S<=RSP[Scissor]; S++)
            {
                int P = i-R-S;
                if(dRSP[R][S][P][1]!=0 || dRSP[R][S][P][2]!=0 || dRSP[R][S][P][3]!=0 || P>RSP[Paper])
                    continue;

                vector<int> oRSP;
                oRSP.resize(4);
                oRSP[Rock] = R;
                oRSP[Scissor] = S;
                oRSP[Paper] = P;
                oRSP[0] = P;
                vector<double> Pro = Probability(oRSP);

                for(int k=0; k<=3; k++)
                {
                    if(R > 0)
                        dRSP[R][S][P][k] += dRSP[R-1][S][P][k]*Pro[Rock];
                    if(S > 0)
                        dRSP[R][S][P][k] += dRSP[R][S-1][P][k]*Pro[Scissor];
                    if(P > 0)
                        dRSP[R][S][P][k] += dRSP[R][S][P-1][k]*Pro[Paper];
                }
            }
        }
    }

    for(int i=1; i<=3; i++)
        printf("%0.12f ", dRSP[RSP[Rock]][RSP[Scissor]][RSP[Paper]][i]);
    cin >> Sum;
}


#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

#define Rock 1
#define Scissor 2
#define Paper 3

double dRSP[101][101][101][4] = {0,};

vector<double> Probability(vector<int> RSP)
{
    vector<double> Pro;
    Pro.resize(4);
    double Pro_Sum = 0;
    int Sum = 0;
    for(int i=1; i<=3; i++)
        Sum += RSP[i];

    for(int i=1; i<=3; i++)
    {
        Pro[i] = 2*RSP[i-1]*RSP[i];
        Pro[i] /= Sum*(Sum-1);
        Pro_Sum += Pro[i];
    }

    Pro[0] = Pro[Paper];

    for(int i=0; i<=3; i++)
        Pro[i] *= 1/Pro_Sum;

    return Pro;
}

int main()
{
    int RSP[4], Sum=0;
    for(int i=1; i<=3; i++)
    {
        cin >> RSP[i];
        Sum += RSP[i];
    }
    RSP[0] = RSP[Paper];

    for(int i=1; i<=Sum; i++)
    {
        if(i <= 100)
        {
            dRSP[0][0][i][0] = 1;
            dRSP[i][0][0][Rock] = 1;
            dRSP[0][i][0][Scissor] = 1;
            dRSP[0][0][i][Paper] = 1;
        }

        for(int R=0; R<=i&&R<=RSP[Rock]; R++)
        {
            for(int S=0; S<=i-R&&S<=RSP[Scissor]; S++)
            {
                int P = i-R-S;
                if(dRSP[R][S][P][1]!=0 || dRSP[R][S][P][2]!=0 || dRSP[R][S][P][3]!=0 || P>RSP[Paper])
                    continue;

                vector<int> oRSP;
                oRSP.resize(4);
                oRSP[Rock] = R;
                oRSP[Scissor] = S;
                oRSP[Paper] = P;
                oRSP[0] = P;
                vector<double> Pro = Probability(oRSP);

                for(int k=0; k<=3; k++)
                {
                    if(R > 0)
                        dRSP[R][S][P][k] += dRSP[R-1][S][P][k]*Pro[Rock];
                    if(S > 0)
                        dRSP[R][S][P][k] += dRSP[R][S-1][P][k]*Pro[Scissor];
                    if(P > 0)
                        dRSP[R][S][P][k] += dRSP[R][S][P-1][k]*Pro[Paper];
                }
            }
        }
    }

    for(int i=1; i<=3; i++)
        printf("%0.12f ", dRSP[RSP[Rock]][RSP[Scissor]][RSP[Paper]][i]);
    cin >> Sum;
}


#include <iostream>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <vector>
#include <stack>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <iomanip>
#include <memory.h>
using namespace std;

const int Nmax=1e2+17;
double long dp[Nmax][Nmax][Nmax]={0};

inline double long res (int x, int y, int z){
	double long t1 = x*y, t2=y*z, t3=x*z;
	return t1/(t1+t2+t3);
}

int main (void){
	//freopen("i.txt","r",stdin);
	//freopen("o.txt", "w+", stdout);
	//std::ios::sync_with_stdio(false);

	int p, r, s;
	cin >> r >> s >> p;
	dp[r][s][p]=1;
	for(int i=r; i>=0; i--)
		for(int z=s; z>=0; z--)
			for(int j=p; j>=0; j--){
				if(i && j) dp[i-1][z][j]+=dp[i][z][j]*res(i, j, z);
				if(z && i) dp[i][z-1][j]+=dp[i][z][j]*res(i, z, j);
				if(j && z) dp[i][z][j-1]+=dp[i][z][j]*res(z, j, i);
			}

	double long ans1=0, ans2=0, ans3=0;
	for(int i=1; i<=r; i++) ans1+=dp[i][0][0];
	for(int i=1; i<=s; i++) ans2+=dp[0][i][0];
	for(int i=1; i<=p; i++) ans3+=dp[0][0][i];

	cout << std::setprecision(9) << ans1 << " " << ans2 << " " << ans3;
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstdio>
#include <complex>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <set>
#include <map>
using namespace std;

#define int64 long long
#define mp make_pair

const int inf = 1e9;
const int MOD = 103;

#ifdef _DEBUG
    const int N = 120;
#else
    const int N = 120;
#endif

int r, s, p;
double dp[N][N][N][3];
bool used[N][N][N][3];

double solve(int a, int b, int c, int f)
{
    if (used[a][b][c][f]) return dp[a][b][c][f];
    if (b == 0 && c == 0)
    {
        if (f == 0) dp[a][b][c][f] = 1;
        else dp[a][b][c][f] = 0;
        return dp[a][b][c][f];
    }
    if (a == 0 && c == 0)
    {
        if (f == 1) dp[a][b][c][f] = 1;
        else dp[a][b][c][f] = 0;
        return dp[a][b][c][f];
    }
    if (a == 0 && b == 0)
    {
        if (f == 2) dp[a][b][c][f] = 1;
        else dp[a][b][c][f] = 0;
        return dp[a][b][c][f];
    }
    double k = 1.0 * a * b + 1.0 * a * c + 1.0 * b * c;
    double p1 = (1.0 * a * b) / k;
    double p2 = (1.0 * a * c) / k;
    double p3 = (1.0 * b * c) / k;
    dp[a][b][c][f] = 0;
    if (a > 0 && b > 0)
        dp[a][b][c][f] += p1 * solve(a, b - 1, c, f);
    if (a > 0 && c > 0)
        dp[a][b][c][f] += p2 * solve(a - 1, b, c, f);
    if (b > 0 && c > 0)
        dp[a][b][c][f] += p3 * solve(a, b, c - 1, f);
    return dp[a][b][c][f];
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cin >> r >> s >> p;
    memset(used, false, sizeof(used));
    cout << fixed << setprecision(9) << solve(r, s, p, 0) << " " << solve(r, s, p, 1) << " " << solve(r, s, p, 2);
    return 0;
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstdio>
#include <complex>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <set>
#include <map>
using namespace std;

#define int64 long long
#define mp make_pair

const int inf = 1e9;
const int MOD = 103;

#ifdef _DEBUG
    const int N = 120;
#else
    const int N = 120;
#endif

int r, s, p;
double dp[N][N][N][3];
bool used[N][N][N][3];

double solve(int a, int b, int c, int f)
{
    if (used[a][b][c][f]) return dp[a][b][c][f];
    used[a][b][c][f] = true;
    if (b == 0 && c == 0)
    {
        if (f == 0) dp[a][b][c][f] = 1;
        else dp[a][b][c][f] = 0;
        return dp[a][b][c][f];
    }
    if (a == 0 && c == 0)
    {
        if (f == 1) dp[a][b][c][f] = 1;
        else dp[a][b][c][f] = 0;
        return dp[a][b][c][f];
    }
    if (a == 0 && b == 0)
    {
        if (f == 2) dp[a][b][c][f] = 1;
        else dp[a][b][c][f] = 0;
        return dp[a][b][c][f];
    }
    double k = 1.0 * a * b + 1.0 * a * c + 1.0 * b * c;
    double p1 = (1.0 * a * b) / k;
    double p2 = (1.0 * a * c) / k;
    double p3 = (1.0 * b * c) / k;
    dp[a][b][c][f] = 0;
    if (a > 0 && b > 0)
        dp[a][b][c][f] += p1 * solve(a, b - 1, c, f);
    if (a > 0 && c > 0)
        dp[a][b][c][f] += p2 * solve(a - 1, b, c, f);
    if (b > 0 && c > 0)
        dp[a][b][c][f] += p3 * solve(a, b, c - 1, f);
    return dp[a][b][c][f];
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cin >> r >> s >> p;
    memset(used, false, sizeof(used));
    cout << fixed << setprecision(9) << solve(r, s, p, 0) << " " << solve(r, s, p, 1) << " " << solve(r, s, p, 2);
    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <iomanip>
using namespace std;

const long double zero = 0.0;
const long double one = 1.0;

struct triple {
    triple():f(zero),s(zero),t(zero){}
    explicit triple(long double a, long double b, long double c) :f(a),s(b),t(c) {}
    triple& operator+=(const triple& rt) {
        f += rt.f;
        s += rt.s;
        t += rt.t;
        return *this;
    }
    triple& operator=(const triple& other) {
        if (this != &other) {
            f = other.f;
            s = other.s;
            t = other.t;
        }
        return *this;
    }
    long double f, s, t;
};

const triple operator+(const triple& lt, const triple& rt) {
    return triple(lt.f + rt.f, lt.s + rt.s, lt.t + rt.t);
}
const triple operator*(const long double lt, const triple& rt) {
    return triple(lt * rt.f, lt * rt.s, lt * rt.t);
}

const int maxn = 101;
triple d[maxn][maxn][maxn];

int main () {

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    int a, b, c;
    cin >> a >> b >> c;

    //d[0][0][0]
    for (int i = 1; i <= a; ++i) {
        d[i][0][0].f = one;
    }
    for (int i = 1; i <= b; ++i) {
        d[0][i][0].s = one;
    }
    for (int i = 1; i <= c; ++i) {
        d[0][0][i].t = one;
    }
    for (int i = 1; i <= a; ++i) {
        for (int j = 0; j <= b; ++j) {
            d[i][j][0].f = one;
        }
    }
    for (int i = 1; i <= a; ++i) {
        for (int j = 0; j <= c; ++j) {
            d[i][0][j].t = one;
        }
    }
    for (int i = 1; i <= b; ++i) {
        for (int j = 0; j <= c; ++j) {
            d[0][i][j].s = one;
        }
    }

    long double n;
    long double x;
    long double f, s, t;
    for (int i = 1; i <= a; ++i) {
        for (int j = 1; j <= b; ++j) {
            for (int k = 1; k <= c; ++k) {
                n = i + j + k;
                x = n * (n - 1.0) / 2.0;
                f = i * (i - 1.0) / 2.0;
                s = j * (j - 1.0) / 2.0;
                t = k * (k - 1.0) / 2.0;
                d[i][j][k] += (i * j) * d[i][j-1][k] + (i * k) * d[i-1][j][k] + (j * k) * d[i][j][k-1];
                d[i][j][k] = (1.0 / (x - f - s - t)) * d[i][j][k];
            }
        }
    }

    cout << setprecision(10) << fixed << d[a][b][c].f << " ";
    cout << setprecision(10) << fixed << d[a][b][c].s << " ";
    cout << setprecision(10) << fixed << d[a][b][c].t;

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include<iterator>
#include<unordered_set>

#define mp make_pair
#define pb push_back
#define x first
#define y second
#define pii pair<int,int>
#define pdd pair<double,double>
#define FOR(i,a,b) for (int _n(b), i(a); i <= _n; ++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i >= _b; --i)
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define rep(i,n) FOR(i,0,(n)-1)
#define VI vector <int>
#define ll long long
#define sqr(x) ((x)*(x))

int ddx[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
int ddy[] = { -1, 0, 1, -1, 1, -1, 0, 1 };
int dx[] = { -1, 1, 0, 0 };
int dy[] = { 0, 0, -1, 1 };

using namespace std;

#define MOD 1000000007
#define R2 500000004
#define R3 333333336
#define INF 1000000000
#define EPS 1e-6
#define PI 3.1415926535897932384626433832795028841971
#define MAX 200011

double dp[111][111][111];
double ans[3];

int main()
{
	int r, s, p;
	cin >> r >> s >> p;
	dp[r][s][p] = 1;
	FORD(S,r+s+p,1)
		FORD(i,r,0)
		FORD(j, s, 0)
	{
		int k = S - i - j;
		if (k < 0 || k > p)continue;
		int ss = i*j + j*k + k*i;
		if (!ss)continue;
		if (i)dp[i - 1][j][k] += dp[i][j][k] * (double)(i*k) / (double)(ss);
		if (j)dp[i][j - 1][k] += dp[i][j][k] * (double)(i*j) / (double)(ss);
		if (k)dp[i][j][k - 1] += dp[i][j][k] * (double)(j*k) / (double)(ss);
	}
	rep(i, r + 1)
		ans[0] += dp[i + 1][0][0];
	rep(j, s + 1)
		ans[1] += dp[0][j + 1][0];
	rep(k, p + 1)
		ans[2] += dp[0][0][k + 1];
	cout.precision(11);
	cout << fixed << ans[0] << ' ';
	cout << fixed << ans[1] << ' ';
	cout << fixed << ans[2] << ' ';
	cin >> r;
	return 0;
}


//#define ONLINE_JUDGE

#if defined(ONLINE_JUDGE)
#define _SECURE_SCL 0
#endif

#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <functional>
#include <memory>
#include <cmath>
#include <climits>
#include <numeric>
#include <tuple>
#include <memory.h>
#include <stdint.h>

#if !defined(__GNUC__)
#else // !defined(__GNUC__)
#define _CrtDbgBreak() __builtin_trap()
#endif // !defined(__GNUC__)

#if defined(ONLINE_JUDGE)
#define LOCAL_TEST 0
#else
#define LOCAL_TEST 1
#endif

#if LOCAL_TEST
struct AssertsCounter
{
    AssertsCounter(): counter(0) {}
    ~AssertsCounter() { std::cout << std::endl << "DIAG: " << (counter == 0 ? "OK" : "!!!") << " Asserts count: " << counter << std::endl; }
    void Increment() { counter++; }
    uint32_t counter;
};
AssertsCounter g_assertsCounter;
#define LOCAL_ASSERT(expr) { if (!(expr)) {std::cout << "ASSERT FAILED (" << __LINE__ << "): '" << #expr << "'" << std::endl; g_assertsCounter.Increment(); _CrtDbgBreak(); } }
#define LOCAL_ASSERT_EQ(expr1, expr2) { if ((expr1) != (expr2)) {std::cout << "ASSERT FAILED (" << __LINE__ << "): '" << #expr1 << "' == '" << #expr2 << "' (" << (expr1) << " vs " << (expr2) << "')" << std::endl; g_assertsCounter.Increment(); _CrtDbgBreak(); } }
#else
#define LOCAL_ASSERT(expr)
#define LOCAL_ASSERT_EQ(expr1, expr2)
#endif

typedef std::string string8_t;

typedef std::vector<size_t> vector_size_t;
typedef std::vector<int32_t> vector_int32_t;
typedef std::vector<uint32_t> vector_uint32_t;
typedef std::vector<int64_t> vector_int64_t;
typedef std::vector<uint64_t> vector_uint64_t;

typedef std::vector<vector_size_t> vector_2d_size_t;
typedef std::vector<string8_t> vector_string8_t;

typedef std::set<size_t> set_size_t;
typedef std::set<int32_t> set_int32_t;
typedef std::set<uint32_t> set_uint32_t;
typedef std::set<int64_t> set_int64_t;
typedef std::set<uint64_t> set_uint64_t;

typedef std::set<string8_t> set_string8_t;
typedef std::multiset<string8_t> multiset_string8_t;

// Auxiliary functions definition
//
template<typename T> inline T Abs(const T a) { return a < 0 ? -a : a; }
template<typename T> inline T Min(const T a, const T b) {return a < b ? a : b;}
template<typename T> inline T Max(const T a, const T b) {return a > b ? a : b;}
template<typename T> inline void UpdateMin(T& a, const T b) {a = Min(a, b);}
template<typename T> inline void UpdateMax(T& a, const T b) {a = Max(a, b);}

static const double eps = 1.0e-09;
template<typename T> inline bool IsEqual(const T a, const T b) { return Abs(a - b) < eps; }
template<typename T> inline bool IsGreater(const T a, const T b) { return a > b + eps; }
template<typename T> inline bool IsLess(const T a, const T b) { return a + eps < b; }

template<typename T> inline string8_t ToStr(const T& val) { std::ostringstream ostr; ostr << val; return ostr.str(); }
template<typename T> inline bool FromStr(const string8_t& str, T& val) {std::istringstream istr(str); istr >> val; return !!istr; }

template<typename T> inline std::istream& operator>>(std::istream& ist, std::vector<T>& data)
{
    for (size_t i = 0; i < data.size(); i++) { ist >> data[i]; }
    return ist;
}

template<typename T> inline std::ostream& operator<<(std::ostream& ost, const std::vector<T>& data)
{
    for (size_t i = 0; i < data.size(); i++) { if (i != 0) { ost << ' '; } ost << data[i]; }
    return ost;
}

#if defined(ONLINE_JUDGE)
template<size_t id> class StopWatch { };
#else
#include <library/lib_stopwatch.h>
#include <library/lib_random.h>
library::random::Rand g_rnd;
#endif

struct state_t
{
    state_t(uint8_t pa, uint8_t pb, uint8_t pc): a(pa), b(pb), c(pc)
    {
    }

    uint16_t GetSum() const
    {
        return (uint16_t)a + b + c;
    }

    state_t GetMinusA() const
    {
        LOCAL_ASSERT(a > 0);
        return state_t(a - 1, b, c);
    }

    state_t GetMinusB() const
    {
        LOCAL_ASSERT(b > 0);
        return state_t(a, b - 1, c);
    }

    state_t GetMinusC() const
    {
        LOCAL_ASSERT(c > 0);
        return state_t(a, b, c - 1);
    }

    bool HasZeros() const
    {
        uint32_t z = 1;
        z *= a;
        z *= b;
        z *= c;
        return z == 0;
    }

    void GetLeader(double& pa, double& pb, double& pc) const
    {
        pa = 0.0;
        pb = 0.0;
        pc = 0.0;
        LOCAL_ASSERT(HasZeros());
        if (a != 0 && c == 0)
        {
            pa = 1.0;
            return;
        }
        if (b != 0 && a == 0)
        {
            pb = 1.0;
            return;
        }
        if (c != 0 && b == 0)
        {
            pc = 1.0;
            return;
        }
    }

    void GetEliminationProbs(double& pa, double& pb, double& pc) const
    {
        pa = 0.0;
        pb = 0.0;
        pc = 0.0;
        LOCAL_ASSERT(!HasZeros());
        const uint32_t ab = (uint32_t)a * b;
        const uint32_t bc = (uint32_t)b * c;
        const uint32_t ca = (uint32_t)c * a;
        const double sum = (double)(ab + bc + ca);
        pa = (double)ca / sum;
        pb = (double)ab / sum;
        pc = (double)bc / sum;
    }

    uint32_t GetValue() const
    {
        uint32_t v = a;
        v <<= 8;
        v |= b;
        v <<= 8;
        v |= c;
        return v;
    }

    bool operator<(const state_t& rv) const
    {
        return GetValue() < rv.GetValue();
    }

    uint8_t a;
    uint8_t b;
    uint8_t c;
};

typedef std::map<state_t, double> map_state_double_t;

void GetAns(const uint8_t a, const uint8_t b, const uint8_t c, double& pa, double& pb, double& pc)
{
    pa = 0.0;
    pb = 0.0;
    pc = 0.0;

    map_state_double_t curr;
    curr[state_t(a, b, c)] = 1.0;

    while (!curr.empty())
    {
        map_state_double_t next;
        for (map_state_double_t::const_iterator ps = curr.begin(); ps != curr.end(); ++ps)
        {
            const state_t& st = ps->first;
            const double p = ps->second;
            if (!st.HasZeros())
            {
                double fa, fb, fc;
                st.GetEliminationProbs(fa, fb, fc);
                next[st.GetMinusA()] += fa * p;
                next[st.GetMinusB()] += fb * p;
                next[st.GetMinusC()] += fc * p;
            }
            else
            {
                double fa, fb, fc;
                st.GetLeader(fa, fb, fc);
                pa += fa * p;
                pb += fb * p;
                pc += fc * p;
            }
        }
        curr.swap(next);
    }
}

bool Solve(std::istream& ist, std::ostream& ost, const bool multipleTestMode)
{
    StopWatch<1> sw; (void)sw;

    //
    size_t a, b, c;
    ist >> a >> b >> c;

    if (multipleTestMode && !ist)
        return false;

#if LOCAL_TEST
    ost << std::endl << "Next test" << std::endl;
#endif

    //
    double pa, pb, pc;
    GetAns((uint8_t)a, (uint8_t)b, (uint8_t)c, pa, pb, pc);
    ost << std::setprecision(12) << std::fixed << pa << ' ' << pb << ' ' << pc << std::endl;

    return multipleTestMode;
}

int main(int argc, const char *argv[])
{
    std::ios_base::sync_with_stdio(false);
    std::istream* ist = &std::cin;
    std::ostream* ost = &std::cout;

    std::unique_ptr<std::istream> fileInput;

    if (argc > 1)
    {
        fileInput.reset(new std::ifstream(argv[1]));
        if (!(*fileInput))
        {
            std::cout << "File not found: " << argv[1] << std::endl;
        }
        ist = fileInput.get();
    }

#if defined(ONLINE_JUDGE)
    Solve(*ist, *ost, false);
#else
    while(Solve(*ist, *ost, true)) {};
#endif
}


#pragma comment(linker, "/STACK:95000000")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <list>
#include <set>
#include <cstdlib>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <stack>
#include <ctime>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
typedef long double ld;
#define mp make_pair
#define pb push_back
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define forn(i, y, x) for(int i = y; i < x; i++)
#define ford(i, y, x) for(int i = y; i >= x; i--)
const int mod = (int)1e9 + 9;
const int inf = (int)1e9;

int main()
{
	int R, S, P;
	scanf("%d %d %d", &R, &S, &P);
	ld cnt[101][101][101] = { 0 };
	cnt[R][S][P] = 1;
	ford(r, R, 0) ford(s, S, 0) ford(p, P, 0){
		if (r == 0 && s == 0) continue;
		if (s == 0 && p == 0) continue;
		if (p == 0 && r == 0) continue;
		ld cur = cnt[r][s][p];
		if (r != 0) cnt[r - 1][s][p] += ((cur * p*r) / (r*s + s*p + p*r));
		if (s != 0) cnt[r][s - 1][p] += ((cur * r*s) / (r*s + s*p + p*r));
		if (p != 0) cnt[r][s][p - 1] += ((cur * s*p) / (r*s + s*p + p*r));
	}
	ld ansR = 0, ansS = 0, ansP = 0;
	forn(i, 1, R + 1) ansR += cnt[i][0][0];
	forn(i, 1, S + 1) ansS += cnt[0][i][0];
	forn(i, 1, P + 1) ansP += cnt[0][0][i];
	printf("%.12lf %.12lf %.12lf", ansR, ansS, ansP);
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <list>
#include <set>
#include <cstdlib>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <stack>
#include <ctime>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
typedef long double ld;
#define mp make_pair
#define pb push_back
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define forn(i, y, x) for(int i = y; i < x; i++)
#define ford(i, y, x) for(int i = y; i >= x; i--)
const int mod = (int)1e9 + 9;
const int inf = (int)1e9;

int main()
{
	int n;
	cin >> n;
	vi cnt(n);
	forn(i, 0, n) cin >> cnt[i];
	sort(cnt.begin(), cnt.end());
	ll sum = 0;
	int ans = 0;
	forn(i, 0, n){
		if (sum <= cnt[i]){
			ans++;
			sum += cnt[i];
		}
	}
	cout << ans;
	return 0;
}


#include <iostream>
#include <iomanip>
using namespace std;

long double dp[101][101][101];

long double prob(int a,int b,int c)
{
	return ((long double)(a*b))/((long double)(a*b+a*c+b*c));
}

long double test(int R,int S,int P)
{
	for(int i=0;i<=R;i++)
		for(int j=0;j<=S;j++)
			for(int k=0;k<=P;k++)
			{
				if((i>0)&&(j==0)&&(k==0)) dp[i][j][k] = 1;
				if(i==0) dp[i][j][k] = 0;
			}
	for(int i=0;i<=R;i++)
		for(int j=0;j<=S;j++)
			for(int k=0;k<=P;k++)
			{
				if((i>0)&&(j==0)&&(k==0)) {dp[i][j][k] = 1;continue;}
				else if(i==0) {dp[i][j][k] = 0;continue;}
				else dp[i][j][k] = 0;
				if((i>0)&&(j>0)) dp[i][j][k] += prob(i,j,k)*dp[i][j-1][k];
				if((i>0)&&(k>0)) dp[i][j][k] += prob(i,k,j)*dp[i-1][j][k];
				if((j>0)&&(k>0)) dp[i][j][k] += prob(j,k,i)*dp[i][j][k-1];
			}
	return dp[R][S][P];
}

int main()
{
	int R,S,P;
	cin >> R >> S >> P;
	cout << setprecision(20) << test(R,S,P) << " " << test(S,P,R) << " " << test(P,R,S) << endl;
	return 0;
}


//hova
//written by mhadih

#include <iostream>
#include <algorithm>
#include <fstream>
#include <cmath>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <iomanip>

using namespace std;

//#define cin inf
//#define cout of

typedef long long ll;
typedef long double ld;

const ll N = 2e2;
const ll M = N*N;
const ll INF = 1e8;
const ll MOD = 1000000007;

struct my
{
	ld a,b,c;
};

my dp[N][N][N];
int f[N][N][N];

my rec(int x,int y,int z)
{
	ld x1 = x , y1 = y , z1 = z;
	//cout << x << ' ' << y << ' ' << z << endl;
	if (f[x][y][z]) return dp[x][y][z];
	f[x][y][z] = 1;
	my ans;
	ans.a = ans.b = ans.c = 0;
	if (x==0 && y==0)
	{
		ans.c = 1e5;
		return dp[x][y][z] = ans;
	}
	if (x==0 && z==0)
	{
		ans.b = 1e5;
		return dp[x][y][z] = ans;
	}
	if (y==0 && z==0)
	{
		ans.a = 1e5;
		return dp[x][y][z] = ans;
	}
	if (x>0)
	{
		my s = rec(x-1,y,z);
		ans.a += s.a*((x1*z1)/(x1*y1+y1*z1+x1*z1));
		ans.b += s.b*((x1*z1)/(x1*y1+y1*z1+x1*z1));
		ans.c += s.c*((x1*z1)/(x1*y1+y1*z1+x1*z1));
	}
	if (y>0)
	{
		my s = rec(x,y-1,z);
		ans.a += s.a*((x1*y1)/(x1*z1+y1*z1+x1*y1));
		ans.b += s.b*((x1*y1)/(x1*z1+y1*z1+x1*y1));
		ans.c += s.c*((x1*y1)/(x1*z1+y1*z1+x1*y1));
	}
	if (z>0)
	{
		my s = rec(x,y,z-1);
		ans.a += s.a*((y1*z1)/(x1*y1+x1*z1+y1*z1));
		ans.b += s.b*((y1*z1)/(x1*y1+x1*z1+y1*z1));
		ans.c += s.c*((y1*z1)/(x1*y1+x1*z1+y1*z1));
	}
	return dp[x][y][z] = ans;
}

int main()
{
    ios::sync_with_stdio(false);
	ifstream inf("input.txt");
	int x,y,z;
	cin >> x >> y >> z;
	my ans = rec(x,y,z);
	cout << setprecision(11) << ans.a/1e5 << ' ' << ans.b/1e5 << ' ' << ans.c/1e5;
}


//hova
//written by mhadih

#include <iostream>
#include <algorithm>
#include <fstream>
#include <cmath>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <iomanip>

using namespace std;

//#define cin inf
//#define cout of

typedef long long ll;
typedef long double ld;

const ll N = 2e2;
const ll M = N*N;
const ll INF = 1e8;
const ll MOD = 1000000007;

struct my
{
	ld a,b,c;
};

my dp[N][N][N];
int f[N][N][N];

my rec(int x,int y,int z)
{
	ld x1 = x , y1 = y , z1 = z;
	cout << x << ' ' << y << ' ' << z << endl;
	if (f[x][y][z]) return dp[x][y][z];
	f[x][y][z] = 1;
	my ans;
	ans.a = ans.b = ans.c = 0;
	if (x==0 && y==0)
	{
		ans.c = 1e5;
		return dp[x][y][z] = ans;
	}
	if (x==0 && z==0)
	{
		ans.b = 1e5;
		return dp[x][y][z] = ans;
	}
	if (y==0 && z==0)
	{
		ans.a = 1e5;
		return dp[x][y][z] = ans;
	}
	if (x>0)
	{
		my s = rec(x-1,y,z);
		ans.a += s.a*((x1*z1)/(x1*y1+y1*z1+x1*z1));
		ans.b += s.b*((x1*z1)/(x1*y1+y1*z1+x1*z1));
		ans.c += s.c*((x1*z1)/(x1*y1+y1*z1+x1*z1));
	}
	if (y>0)
	{
		my s = rec(x,y-1,z);
		ans.a += s.a*((x1*y1)/(x1*z1+y1*z1+x1*y1));
		ans.b += s.b*((x1*y1)/(x1*z1+y1*z1+x1*y1));
		ans.c += s.c*((x1*y1)/(x1*z1+y1*z1+x1*y1));
	}
	if (z>0)
	{
		my s = rec(x,y,z-1);
		ans.a += s.a*((y1*z1)/(x1*y1+x1*z1+y1*z1));
		ans.b += s.b*((y1*z1)/(x1*y1+x1*z1+y1*z1));
		ans.c += s.c*((y1*z1)/(x1*y1+x1*z1+y1*z1));
	}
	return dp[x][y][z] = ans;
}

int main()
{
    ios::sync_with_stdio(false);
	ifstream inf("input.txt");
	int x,y,z;
	cin >> x >> y >> z;
	my ans = rec(x,y,z);
	cout << setprecision(11) << ans.a/1e5 << ' ' << ans.b/1e5 << ' ' << ans.c/1e5;
}


#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 200001
#define mod 10007
#define eps 1e-9
int Num;
char CH[20];
//const int inf=0x7fffffff;   //��?�쨦�쨤�쨦��f��3
const int inf=0x3f3f3f3f;
/*

inline void P(int x)
{
    Num=0;if(!x){putchar("0");puts("");return;}
    while(x>0)CH[++Num]=x%10,x/=10;
    while(Num)putchar(CH[Num--]+48);
    puts("");
}
*/
inline ll read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<"0"||ch>"9"){if(ch=="-")f=-1;ch=getchar();}
    while(ch>="0"&&ch<="9"){x=x*10+ch-"0";ch=getchar();}
    return x*f;
}
inline void P(int x)
{
    Num=0;if(!x){putchar("0");puts("");return;}
    while(x>0)CH[++Num]=x%10,x/=10;
    while(Num)putchar(CH[Num--]+48);
    puts("");
}
//**************************************************************************************

double dp[110][110][110];

int main()
{
    int r,s,p;
    cin>>r>>s>>p;
    dp[r][s][p]=1;
    double ans1=0,ans2=0,ans3=0;
    for(int i=r;i>=0;i--)
    {
        for(int j=s;j>=0;j--)
        {
            for(int k=p;k>=0;k--)
            {
                double tmp=(i+j+k)*(i+j+k-1)/2-(i*(i-1)/2)-j*(j-1)/2-k*(k-1)/2;
                if (j>0&&i>0)
                    dp[i][j-1][k]+=dp[i][j][k]*i*j/tmp;
                if (j>0&&k>0)
                    dp[i][j][k-1]+=dp[i][j][k]*j*k/tmp;
                if (i>0&&k>0)
                    dp[i-1][j][k]+=dp[i][j][k]*k*i/tmp;
            }
        }
    }
    for(int i=r;i>=0;i--)
        ans1+=dp[i][0][0];
    for(int j=s;j>=0;j--)
        ans2+=dp[0][j][0];
    for(int k=p;k>=0;k--)
        ans3+=dp[0][0][k];
    printf("%.10f %.10f %.10f\n",ans1,ans2,ans3);
}


#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 200001
#define mod 10007
#define eps 1e-9
int Num;
char CH[20];
//const int inf=0x7fffffff;   //��?�쨦�쨤�쨦��f��3
const int inf=0x3f3f3f3f;
/*

inline void P(int x)
{
    Num=0;if(!x){putchar("0");puts("");return;}
    while(x>0)CH[++Num]=x%10,x/=10;
    while(Num)putchar(CH[Num--]+48);
    puts("");
}
*/
inline ll read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
inline void P(int x)
{
    Num=0;if(!x){putchar('0');puts("");return;}
    while(x>0)CH[++Num]=x%10,x/=10;
    while(Num)putchar(CH[Num--]+48);
    puts("");
}
//**************************************************************************************

double dp[110][110][110];

int main()
{
    int r,s,p;
    cin>>r>>s>>p;
    dp[r][s][p]=1;
    double ans1=0,ans2=0,ans3=0;
    for(int i=r;i>=0;i--)
    {
        for(int j=s;j>=0;j--)
        {
            for(int k=p;k>=0;k--)
            {
                double tmp=(i+j+k)*(i+j+k-1)/2-(i*(i-1)/2)-j*(j-1)/2-k*(k-1)/2;
                if (j>0&&i>0)
                    dp[i][j-1][k]+=dp[i][j][k]*i*j/tmp;
                if (j>0&&k>0)
                    dp[i][j][k-1]+=dp[i][j][k]*j*k/tmp;
                if (i>0&&k>0)
                    dp[i-1][j][k]+=dp[i][j][k]*k*i/tmp;
            }
        }
    }
    for(int i=r;i>=0;i--)
        ans1+=dp[i][0][0];
    for(int j=s;j>=0;j--)
        ans2+=dp[0][j][0];
    for(int k=p;k>=0;k--)
        ans3+=dp[0][0][k];
    printf("%.10f %.10f %.10f\n",ans1,ans2,ans3);
}


#include <stdio.h>
#include <stdlib.h>
#include<iostream>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <string.h>
#include <string>
#include <limits.h>
#include <algorithm>
#include <set>
#include <ctime>
using namespace std;
#define SZ(x) ((int)(x).size())
#define rep(i,a,n) for (int i=a; i<(int)n; i++)
#define per(i,n,a) for (int i=n; i>=a; i--)
#define hk push_back
#define pk pop_back
#define mp make_pair
#define PI 3.141592653589793
#define clr(a) memset(a, 0, sizeof(a))
#define clr1(a) memset(a, -1, sizeof(a))
typedef vector<int> VI;
typedef vector< pair<int, int> > VIP;
typedef vector< pair<int, pair<int, double> > > VIPP;
typedef vector<string> VS;
typedef vector <double> VD;
typedef vector <bool> VB;
typedef long long ll;
#define MAX_V 1000
const ll mod = 1000000007;
ll powmod(ll a, ll b) {
    ll res = 1; a %= mod; for (; b; b >>= 1){ if (b & 1)res = res*a%mod; a = a*a%mod; }return res;
}

int r, s, p;
double dp1[100][100][100], dp2[100][100][100];

double getProb(int rr, int ss, int pp) {
    if (rr == 0) return 0;
    if (pp == 0) return 1;
    if (ss == 0) return 0;

    double& ret = dp1[rr][ss][pp];
    if (ret != 0) return ret;

    double p = rr * ss + ss * pp + pp * rr;
    return ret = (getProb(rr, ss - 1, pp) * rr * ss + getProb(rr, ss, pp - 1) * pp * ss + getProb(rr - 1, ss, pp) * rr * pp) / p;
}

double getProb1(int rr, int ss, int pp) {
    if (ss == 0) return 0;
    if (rr == 0) return 1;
    if (pp == 0) return 0;

    double& ret = dp2[rr][ss][pp];
    if (ret != 0) return ret;

    double p = rr * ss + ss * pp + pp * rr;
    return ret = (getProb1(rr, ss - 1, pp) * rr * ss + getProb1(rr, ss, pp - 1) * pp * ss + getProb1(rr - 1, ss, pp) * rr * pp) / p;
}

int main()
{
    cout.precision(12);
    clr(dp1); clr(dp2);
    cin >> r >> s >> p;
    double rWin = getProb(r, s, p);
    double sWin = getProb1(r, s, p);
    double pWin = 1 - rWin - sWin;
    cout << rWin << " " << sWin << " " << pWin << endl;

}


#include <stdio.h>
#include <stdlib.h>
#include<iostream>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <string.h>
#include <string>
#include <limits.h>
#include <algorithm>
#include <set>
#include <ctime>
using namespace std;
#define SZ(x) ((int)(x).size())
#define rep(i,a,n) for (int i=a; i<(int)n; i++)
#define per(i,n,a) for (int i=n; i>=a; i--)
#define hk push_back
#define pk pop_back
#define mp make_pair
#define PI 3.141592653589793
#define clr(a) memset(a, 0, sizeof(a))
#define clr1(a) memset(a, -1, sizeof(a))
typedef vector<int> VI;
typedef vector< pair<int, int> > VIP;
typedef vector< pair<int, pair<int, double> > > VIPP;
typedef vector<string> VS;
typedef vector <double> VD;
typedef vector <bool> VB;
typedef long long ll;
#define MAX_V 1000
const ll mod = 1000000007;
ll powmod(ll a, ll b) {
    ll res = 1; a %= mod; for (; b; b >>= 1){ if (b & 1)res = res*a%mod; a = a*a%mod; }return res;
}

int r, s, p;
double dp1[101][101][101], dp2[101][101][101];

double getProb(int rr, int ss, int pp) {
    if (rr == 0) return 0;
    if (pp == 0) return 1;
    if (ss == 0) return 0;

    double& ret = dp1[rr][ss][pp];
    if (ret != 0) return ret;

    double p = rr * ss + ss * pp + pp * rr;
    return ret = (getProb(rr, ss - 1, pp) * rr * ss + getProb(rr, ss, pp - 1) * pp * ss + getProb(rr - 1, ss, pp) * rr * pp) / p;
}

double getProb1(int rr, int ss, int pp) {
    if (ss == 0) return 0;
    if (rr == 0) return 1;
    if (pp == 0) return 0;

    double& ret = dp2[rr][ss][pp];
    if (ret != 0) return ret;

    double p = rr * ss + ss * pp + pp * rr;
    return ret = (getProb1(rr, ss - 1, pp) * rr * ss + getProb1(rr, ss, pp - 1) * pp * ss + getProb1(rr - 1, ss, pp) * rr * pp) / p;
}

int main()
{
    cout.precision(12);
    clr(dp1); clr(dp2);
    cin >> r >> s >> p;
    double rWin = getProb(r, s, p);
    double sWin = getProb1(r, s, p);
    double pWin = 1 - rWin - sWin;
    cout << rWin << " " << sWin << " " << pWin << endl;

}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN = 105;
double dp[MAXN][MAXN][MAXN];
int main()
{
        int N;
        int R,S,P;
        while(~scanf("%d%d%d",&R,&S,&P)) {
                memset(dp,0,sizeof(dp));
                dp[R][S][P]=1;
                for(int i=R;i>0;--i) {
                        for(int j=S;j>0;--j) {
                                for(int k=P;k>0;--k) {
                                        int sum=i*j+j*k+i*k;
                                        dp[i][j-1][k]+=dp[i][j][k]*i*j/sum;
                                        dp[i][j][k-1]+=dp[i][j][k]*j*k/sum;
                                        dp[i-1][j][k]+=dp[i][j][k]*i*k/sum;
                                }
                        }
                }
                double rp=0,sp=0,pp=0;
                for(int i=0;i<=R;++i) {
                        for(int j=0;j<=S;++j) {
                                rp+=dp[i][j][0];
                        }
                }
                for(int i=0;i<=S;++i) {
                        for(int j=0;j<=P;++j) {
                                sp+=dp[0][i][j];
                        }
                }
                for(int i=0;i<=R;++i) {
                        for(int j=0;j<=P;++j) {
                                pp+=dp[i][0][j];
                        }
                }
                printf("%.12f %.12f %.12f\n",rp,sp,pp);
        }
        return 0;
}


#pragma comment(linker, "/STACK:134217728")

#include <cstdio>
#include <cmath>
#include <string>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <queue>
#include <memory.h>
#include <time.h>

using namespace std;

typedef long long LL;

int r, p, s;

double dp[111][111][111];

double go(int r, int s, int p)
{
	if (max(max(r, s), p) == r + s + p)
		return r != 0;
	double & res = dp[r][s][p];

	if (res != -1.0)
		return res;

	int total = r * s + s * p + p * r;
	res = 0;
	if (r > 0 && s > 0)
	{
		res += ((0.0 + r * s) / total) * go(r, s - 1, p);
	}
	if (s > 0 && p > 0)
	{
		res += ((0.0 + s * p) / total) * go(r, s, p - 1);
	}
	if (p > 0 && r > 0)
	{
		res += ((0.0 + p * r) / total) * go(r - 1, s, p);
	}

	return res;
}

int a[3];

int main()
{
	for(int i = 0; i < 3; ++i)
		scanf("%d", &a[i]);

	for(int it = 0; it < 3; ++it)
	{
		for(int i = 0; i < 111; ++i)
			for(int j = 0; j < 111; ++j)
				for(int k = 0; k < 111; ++k)
					dp[i][j][k] = -1.0;

		printf("%.10lf ", go(a[0], a[1], a[2]));
		rotate(a, a + 1, a + 3);
	}

	printf("\n");
	return 0;
}


#include <iostream>
#include <math.h>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <fstream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>

#define ALL(x) (x).begin(), (x).end()
#define mp make_pair
#define vec vector
#define deb(x) cerr << #x << " = " << x << '\n';

typedef unsigned long long ull;
typedef long double LD;
typedef long long LL;

const LL inf = 1000000000ll;
const LL inf64 = inf * inf;
const LL base = inf + 7;
const LL MOD = inf + 9;
const double pi = acos(-1.0);

using namespace std;

bool solve()
{
    int r, s, p;

    scanf("%d %d %d", &r, &s, &p);

    const int N = 110;
    double dp[N][N][N];

    for(int i(0);i < N;i++) {
        for(int j(0);j < N;j++) {
            for(int z(0);z < N;z++){
                dp[i][j][z] = 0.0;
            }
        }
    }

    dp[r][s][p] = 1.0;

    for(int i(r);i >= 0;i--) {
        for(int j(s);j >= 0;j--) {
            for(int z(p);z >= 0;z--) {
                if(i == 0 && j == 0) continue;
                if(i == 0 && z == 0) continue;
                if(j == 0 && z == 0) continue;
                double cur = dp[i][j][z];
                double A, B, C;
                A = i * j;
                B = j * z;
                C = z * i;
                double all = A + B + C;
                if(i) dp[i - 1][j][z] += cur * C / all;
                if(j) dp[i][j - 1][z] += cur * A / all;
                if(z) dp[i][j][z - 1] += cur * B / all;
            }
        }
    }

    double A, B, C;
    A = B = C = 0;

    for(int i(1);i <= r;i++) A += dp[i][0][0];
    for(int i(1);i <= s;i++) B += dp[0][i][0];
    for(int i(1);i <= p;i++) C += dp[0][0][i];

    cout.precision(10);
    cout << fixed;

    cout << A << ' ' << B << ' ' << C << '\n';

    return true;
}

int main()
{
    //while(solve());
    solve();

    return 0;
}


#include <iostream>
#include <math.h>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <fstream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>

#define ALL(x) (x).begin(), (x).end()
#define mp make_pair
#define vec vector
#define deb(x) cerr << #x << " = " << x << '\n';

typedef unsigned long long ull;
typedef long double LD;
typedef long long LL;

const LL inf = 1000000000ll;
const LL inf64 = inf * inf;
const LL base = inf + 7;
const LL MOD = inf + 9;
const double pi = acos(-1.0);

using namespace std;

bool solve()
{
    int r, s, p;

    scanf("%d %d %d", &r, &s, &p);

    const int N = 110;
    double dp[N][N][N];

    for(int i(0);i < N;i++) {
        for(int j(0);j < N;j++) {
            for(int z(0);z < N;z++){
                dp[i][j][z] = 0.0;
            }
        }
    }

    dp[r][s][p] = 1.0;

    for(int i(r);i >= 0;i--) {
        for(int j(s);j >= 0;j--) {
            for(int z(p);z >= 0;z--) {
                int c = !i + !j + !z;
                if(c >= 2) continue;
                double cur = dp[i][j][z];
                double A, B, C;
                A = i * j;
                B = j * z;
                C = z * i;
                double all = A + B + C;
                if(i) dp[i - 1][j][z] += cur * C / all;
                if(j) dp[i][j - 1][z] += cur * A / all;
                if(z) dp[i][j][z - 1] += cur * B / all;
            }
        }
    }

    double A, B, C;
    A = B = C = 0;

    for(int i(1);i <= r;i++) A += dp[i][0][0];
    for(int i(1);i <= s;i++) B += dp[0][i][0];
    for(int i(1);i <= p;i++) C += dp[0][0][i];

    cout.precision(10);
    cout << fixed;

    cout << A << ' ' << B << ' ' << C << '\n';

    return true;
}

int main()
{
    //while(solve());
    solve();

    return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 105;
double dp[N][N][N];
int r, s, p;

int main()
{
	while(~scanf("%d%d%d", &r, &s, &p))
	{
		memset(dp, 0, sizeof(dp));
		dp[r][s][p] = 1;
		for(int i = r; i >= 0; i--)
		{
			for(int j = s; j >= 0; j--)
			{
				for(int k = p; k >= 0; k--)
				{
					if(!i && !j || !i && !k || !j && !k) continue;
					double ans = dp[i][j][k];
					double tmp = i*j + i*k + j*k;
					if(i) dp[i-1][j][k] += ans*double(i*k)/tmp;
					if(j) dp[i][j-1][k] += ans*double(i*j)/tmp;
					if(k) dp[i][j][k-1] += ans*double(j*k)/tmp;
				}
			}
		}
		double a = 0, b = 0, c = 0;
		for(int i = 1; i <= r; i++) a += dp[i][0][0];
		for(int j = 1; j <= s; j++) b += dp[0][j][0];
		for(int k = 1; k <= p; k++) c += dp[0][0][k];
		printf("%.9lf %.9lf %.9lf\n", a, b, c);
	}
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
using namespace std;
double dp[101][101][101]={0};
#define ret dp[n][m][k]
double pairs(int n,int m ,int k){
	return n*m + m*k+n*k;
}
double DP(int n,int m, int k){
	if(dp[n][m][k]!=-1) return dp[n][m][k];

	ret = 0;

if(pairs(n+1,m,k))	ret+= DP(n+1,m,k)* (n+1)*k/pairs(n+1,m,k);
if(pairs(n,m+1,k))	ret+= DP(n,m+1,k)* (m+1)*n/pairs(n,m+1,k);
	if(pairs(n,m,k+1))ret+= DP(n,m,k+1)* (k+1)*m/pairs(n,m,k+1);
	return ret;
}

int main(){
int n,m,k;
	cin>>n>>m>>k;
	for(int i=0;i<=n;++i)
		for(int j=0;j<=m;++j)
			for(int kk=0;kk<=k;++kk)
				dp[i][j][kk]=-1;
	dp[n][m][k]=1;
	double ans[3]={0};
	DP(1,1,1);
	DP(0,0,1);
	for(int i=1;i<=max(n,max(m,k));++i)
	{
		ans[0]+=DP(i,0,0);
		ans[1]+=DP(0,i,0);
		ans[2]+=DP(0,0,i);
	}
	printf("%.9lf %.9lf %.9lf ",ans[0],ans[1],ans[2]);
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
using namespace std;
double dp[106][105][105]={0};
#define ret dp[n][m][k]
double pairs(int n,int m ,int k){
	return n*m + m*k+n*k;
}
double DP(int n,int m, int k){
	if(dp[n][m][k]!=-1) return dp[n][m][k];

	ret = 0;

if(pairs(n+1,m,k))	ret+= DP(n+1,m,k)* (n+1)*k/pairs(n+1,m,k);
if(pairs(n,m+1,k))	ret+= DP(n,m+1,k)* (m+1)*n/pairs(n,m+1,k);
	if(pairs(n,m,k+1))ret+= DP(n,m,k+1)* (k+1)*m/pairs(n,m,k+1);
	return ret;
}

int main(){
int n,m,k;
	cin>>n>>m>>k;
	for(int i=0;i<=n;++i)
		for(int j=0;j<=m;++j)
			for(int kk=0;kk<=k;++kk)
				dp[i][j][kk]=-1;
	dp[n][m][k]=1;
	double ans[3]={0};
	DP(1,1,1);
	DP(0,0,1);
	for(int i=1;i<=max(n,max(m,k));++i)
	{
		ans[0]+=DP(i,0,0);
		ans[1]+=DP(0,i,0);
		ans[2]+=DP(0,0,i);
	}
	printf("%.9lf %.9lf %.9lf ",ans[0],ans[1],ans[2]);
}


#include <iostream>

using namespace std;

struct pCell
{
	long double pR, pP, pS;

	pCell()
	{
		pR = 0;
		pP = 0;
		pS = 0;
	}
};

int r, s, p;
pCell dp[101][101][101];

void read()
{
	cin >> r >> s >> p;
}

void init()
{
	dp[1][0][0].pR = 1;
	dp[1][0][0].pS = 0;
	dp[1][0][0].pP = 0;

	dp[0][1][0].pR = 0;
	dp[0][1][0].pS = 1;
	dp[0][1][0].pP = 0;

	dp[0][0][1].pR = 0;
	dp[0][0][1].pS = 0;
	dp[0][0][1].pP = 1;
}

pCell buildDp(int r, int s, int p)
{
	if (dp[r][s][p].pR == 0 && dp[r][s][p].pS == 0 && dp[r][s][p].pP == 0)
	{
		int div = r*s + r*p + s*p;
		double prob;
		pCell dpAux;

		//Case 1
		if (r != 0)
		{
			if (div != 0)
			{
				prob = (double(r*p) / div);
			}
			else
			{
				prob = 1;
			}
			dpAux = buildDp(r - 1, s, p);
			dp[r][s][p].pR += prob*dpAux.pR;
			dp[r][s][p].pS += prob*dpAux.pS;
			dp[r][s][p].pP += prob*dpAux.pP;
		}

		//Casse 2
		if (s != 0)
		{
			if (div != 0)
			{
				prob = (double(r*s) / div);
			}
			else
			{
				prob = 1;
			}
			dpAux = buildDp(r, s - 1, p);
			dp[r][s][p].pR += prob*dpAux.pR;
			dp[r][s][p].pS += prob*dpAux.pS;
			dp[r][s][p].pP += prob*dpAux.pP;
		}

		//Case 3
		if (p != 0)
		{
			if (div != 0)
			{
				prob = (double(s*p) / div);
			}
			else
			{
				prob = 1;
			}
			dpAux = buildDp(r, s, p - 1);
			dp[r][s][p].pR += prob*dpAux.pR;
			dp[r][s][p].pS += prob*dpAux.pS;
			dp[r][s][p].pP += prob*dpAux.pP;
		}
	}

	return dp[r][s][p];
}

int main()
{
	//FILE *file1 = new FILE;
	//FILE *file2 = new FILE;
	//freopen_s(&file1, "input.txt", "r", stdin);
	//freopen_s(&file2, "output.txt", "w", stdout);

	read();
	init();
	buildDp(r,s,p);

	printf("%.12f ", dp[r][s][p].pR);
	printf("%.12f ", dp[r][s][p].pS);
	printf("%.12f" , dp[r][s][p].pP);
	//cout << dp[r][s][p].pS << " ";

	return 0;
}


#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <stdio.h>
#include <iomanip>
using namespace std;

int p, s, r;
vector<vector<vector<double>>> rockprobe;
vector<vector<vector<double>>> scissprobe;
vector<vector<vector<double>>> paperprobe;

vector<vector<vector<bool>>> was;

void next_val(int i, int j, int k)
{
    if (i < 0 || j < 0 || k < 0) return;
    if (!was[i][j][k]) return;
    was[i][j][k] = false;
    if (j == 0)
    {
        rockprobe[i][j][k] = 0;
        paperprobe[i][j][k] = 1;
        return;
    }
    if (i == 0)
    {
        scissprobe[i][j][k] = 1;
        paperprobe[i][j][k] = 0;
        return;
    }
    if (k == 0)
    {
        scissprobe[i][j][k] = 0;
        rockprobe[i][j][k] = 1;
        return;
    }
    next_val(i - 1, j, k);
    next_val(i, j - 1, k);
    next_val(i, j, k - 1);
    rockprobe[i][j][k] = (i * k * rockprobe[i - 1][j][k] + k * j * rockprobe[i][j][k - 1] + j * i * rockprobe[i][j - 1][k])/(i * k + j * k + i * j);
    paperprobe[i][j][k] = (i * k * paperprobe[i - 1][j][k] + k * j *paperprobe[i][j][k - 1] + j * i * paperprobe[i][j - 1][k])/(i * k + j * k + i * j);
    scissprobe[i][j][k] = (j * i * scissprobe[i][j - 1][k] + k * j *scissprobe[i][j][k - 1] + i * k *scissprobe[i - 1][j][k])/(i * k + j * k + i * j);
}

int main()
{
    cin>>r>>s>>p;
    rockprobe.assign(r + 1, vector<vector<double>>(s + 1, vector<double>(p + 1)));
    scissprobe.assign(r + 1, vector<vector<double>>(s + 1, vector<double>(p + 1)));
    paperprobe.assign(r + 1, vector<vector<double>>(s + 1, vector<double>(p + 1)));
    was.assign(r + 1, vector<vector<bool>>(s + 1, vector<bool>(p + 1, true)));
    for (int i = 1; i <= r; ++i)
    {
        rockprobe[i][0][0] = 1;
        was[i][0][0] = false;
    }
    for (int i = 1; i <= s; ++i)
    {
        scissprobe[0][i][0] = 1;
        was[0][i][0] = false;
    }
    for (int i = 1; i <= p; ++i)
    {
        paperprobe[0][0][i] = 1;
        was[0][0][i] = false;
    }
    was[0][0][0] = false;
    next_val(r, s, p);
    cout<<setprecision(12)<<fixed<<rockprobe[r][s][p]<<' '<<scissprobe[r][s][p]<<' '<<paperprobe[r][s][p];
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <cmath>
#include <ctime>

using namespace std;

typedef unsigned long long u64;
typedef long long i64;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<i64> vi64;
typedef vector< vector<i64> > vvi64;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<pii> vii;

const int MOD = 1000000007;
const i64 INF = (i64)10 * MOD;

long double dp[110][110][110];

int main()
{
	// std::ios_base::sync_with_stdio(false);
	// freopen("inp.txt", "r", stdin);
	// freopen("out.txt","w", stdout);

	int R, S, P;
	cin >> R >> S >> P;

	memset(dp, 0.0, sizeof(dp));
	dp[R][S][P] = 1.0;
	for (int r = R; r >= 0; --r) {
		for (int s = S; s >= 0; --s) {
			for (int p = P; p >= 0; --p) {
				int sum = r * s + r * p + s * p;
				if (r * s > 0) {
					dp[r][s - 1][p] += dp[r][s][p] * r * s / sum;
				}
				if (r * p > 0) {
					dp[r - 1][s][p] += dp[r][s][p] * r * p / sum;
				}
				if (s * p > 0) {
					dp[r][s][p - 1] += dp[r][s][p] * s * p / sum;
				}
			}
		}
	}

	long double rock = 0.0, sci = 0.0, paper = 0.0;
	for (int i = 1; i <= 100; ++i) {
		rock += dp[i][0][0];
		sci += dp[0][i][0];
		paper += dp[0][0][i];
	}
	printf("%.10llf %.10llf %.10llf", rock, sci, paper);
	// system("PAUSE");
	return 0;
}


#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <cassert>
#include <ctime>

#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iterator>
#include <functional>
#include <numeric>
#include <limits>

using namespace std;

typedef long long int64;
typedef unsigned long long uint64;

template<typename T> inline T sqr(T x) { return x*x; }
#define mp make_pair
#define forn(i, n) for(int i = 0; i < (n); ++i)
#define forn1(i, n) for(int i = 1; i <= (n); ++i)
#define forr(i, n) for(int i = (n)-1; i >= 0; --i)
#define forit(i,c) for(i = (c).begin(); i != (c).end(); ++i)
#define all(x) (x).begin(), (x).end()
#define zero(a) memset((a), 0, sizeof(a))

typedef vector<int> vint;
typedef vector<bool> vbool;
typedef vector<int64> vint64;
typedef pair<int, int> pii;
typedef pair<int64, int64> pii64;
typedef pair<double, double> pdd;

const int MAXN = 105;

struct Node
{
	double v1;
	double v2;
	double v3;

	Node() {}

	Node(double v1, double v2, double v3)
		: v1(v1), v2(v2), v3(v3)
	{}

	double GetS() { return v1 + v2 + v3; }
	void Norm()
	{
		double s = GetS();
		v1 /= s;
		v2 /= s;
		v3 /= s;
	}

	double Get1() { return v1; }
	double Get2() { return v2; }
	double Get3() { return v3; }

	Node& operator +=(const Node& other)
	{
		v1 += other.v1;
		v2 += other.v2;
		v3 += other.v3;
		return *this;
	}

	Node operator*(double val)
	{
		Node res = *this;
		res.v1 *= val;
		res.v2 *= val;
		res.v3 *= val;
		return res;
	}
};

Node dp[MAXN][MAXN][MAXN];

int Beat[3][3] = {
	{ 0, 1, 0 },
	{ 0, 0, 1 },
	{ 1, 0, 0 },
};

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#endif

	forn(i1, MAXN)
	{
		forn(i2, MAXN)
		{
			forn(i3, MAXN)
			{
				Node& cur = dp[i1][i2][i3];
				if (i1 == 0 && i2 == 0 && i3 == 0) cur = Node(0, 0, 0);
				else if (i1 == 0 && i2 == 0) cur = Node(0, 0, 1);
				else if (i1 == 0 && i3 == 0) cur = Node(0, 1, 0);
				else if (i3 == 0 && i2 == 0) cur = Node(1, 0, 0);
				else
				{
					cur = Node(0, 0, 0);
					int c[3] = {i1, i2, i3};
					int s = i1 + i2 + i3;
					double sp = 0;
					forn(i, 3)
					{
						for (int j = i + 1; j < 3; ++j)
						{
							if (c[i] == 0 || c[j] == 0) continue;
							double p = (double)(2 * c[i] * c[j]) / (s*(s - 1));
							sp += p;
							Node* target = 0;
							int minusInd = Beat[i][j] ? j : i;
							if (minusInd == 0) target = &dp[i1 - 1][i2][i3];
							if (minusInd == 1) target = &dp[i1][i2 - 1][i3];
							if (minusInd == 2) target = &dp[i1][i2][i3 - 1];
							cur += (*target) * p;
						}
					}
				}
				cur.Norm();
			}
		}
	}

	int a, b, c;
	cin >> a >> b >> c;
	Node res = dp[a][b][c];
	printf("%.9f %.9f %.9f\n", res.Get1(), res.Get2(), res.Get3());

	return 0;
}


#include<stdio.h>
int main(){
	int t,a,b,c,n;
	scanf("%d", &t);
	for(int i=1;i<=t;i++){
		scanf("%d%d%d%d", &a,&b,&c,&n);
		int x=a+b+c+n;
		int y=a+b+c;
		if(x%3==0||y%3==1&&n%3==2||y%3==2&&n%3==1) printf("YES\n");
		else printf("NO\n");
	}
   return 0;
}


#include<stdio.h>
int main(){
	int t,a,b,c,n;
	scanf("%d", &t);
	for(int i=1;i<=t;i++){
		scanf("%d%d%d%d", &a,&b,&c,&n);
		int x=a+b+c+n;
		int y=x/3;
		if(x%3==0&&y>=a&&y>=b&&y>=c) printf("YES\n");
		else printf("NO\n");
	}
   return 0;
}


#include<stdio.h>
int main(){
	int t,a,b,c,n;
	scanf("%d", &t);
	for(int i=1;i<=t;i++){
		scanf("%d%d%d%d", &a,&b,&c,&n);
		int x=a+b+c+n;
		if(x%3==0 && n>=3) printf("YES\n");
		else printf("NO\n");
	}
   return 0;
}


#include<stdio.h>
int main(){
	int t,a,b,c,n;
	scanf("%d", &t);
	for(int i=1;i<=t;i++){
		scanf("%d%d%d%d", &a,&b,&c,&n);
		int x=a+b+c+n;
		if(x%3==0) printf("YES\n");
		else printf("NO\n");
	}
   return 0;
}


#include <stdio.h>
int main(){
    int n;
    scanf("%d", &n);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
int main(){
	int n, ans=1;
	scanf("%d", &n);
	int* tests;
	tests=(int*)malloc(4*sizeof(int));
	int i=0;
	for(i=0; i<n; i++){
		scanf("%d %d %d %d", &tests[0], &tests[1], &tests[2], &tests[3]);
		int sum=0, j;
		for(j=0; j<4; j++){
			sum+=tests[j];
		}
		if(sum%3==0){
			for(j=0; j<3; j++){
				if(tests[j]>(sum/3)){
					ans=0;
				}
			}
			if(ans==0){
				printf("NO\n");
			}
			else{
				printf("YES\n");
			}
		}
		else{
			printf("NO\n");
		}
	}
	free(tests);
	return 0;

}


#include <stdio.h>
#include <stdlib.h>
int main(){
	int n, ans=1;
	scanf("%d", &n);
	long long int* tests;
	tests=(long long int*)malloc(4*sizeof(long long int));
	int i=0;
	for(i=0; i<n; i++){
		scanf("%lld %lld %lld %lld", &tests[0], &tests[1], &tests[2], &tests[3]);
		int j;
		long long int sum=0;
		for(j=0; j<4; j++){
			sum+=tests[j];
		}
		if(sum%3==0){
			for(j=0; j<3; j++){
				if(tests[j]>(sum/3)){
					ans=0;
				}
			}
			if(ans==0){
				printf("NO");
			}
			else{
				printf("YES");
			}
		}
		else{
			printf("NO");
		}
		if(n-i>1){
			printf("\n");
		}
	}
	free(tests);
	return 0;

}


#include <stdio.h>
int main(){
    printf("YES\n");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
int main(){
	int n, ans=1;
	scanf("%d", &n);
	long long int* tests;
	tests=(long long int*)malloc(4*sizeof(long long int));
	int i=0;
	for(i=0; i<n; i++){
		ans = 1;
		scanf("%lld %lld %lld %lld", &tests[0], &tests[1], &tests[2], &tests[3]);
		int j;
		long long int sum=0;
		for(j=0; j<4; j++){
			sum+=tests[j];
		}
		if(sum%3==0){
			for(j=0; j<3; j++){
				if(tests[j]>(sum/3)){
					ans=0;
				}
			}
			if(ans==0){
				printf("NO");
			}
			else{
				printf("YES");
			}
		}
		else{
			printf("NO");
		}
		if(n-i>1){
			printf("\n");
		}
	}
	free(tests);
	return 0;

}


#include <stdio.h>
#include <stdlib.h>
int main(){
	int n, ans=1;
	scanf("%d", &n);
	long long int* tests;
	tests=(long long int*)malloc(4*sizeof(long long int));
	int i=0;
	for(i=0; i<n; i++){
		scanf("%lld %lld %lld %lld", &tests[0], &tests[1], &tests[2], &tests[3]);
		int j;
		long long int sum=0;
		for(j=0; j<4; j++){
			sum+=tests[j];
		}
		if(sum%3==0){
			for(j=0; j<3; j++){
				if(tests[j]>(sum/3)){
					ans=0;
				}
			}
			if(ans==0){
				printf("NO\n");
			}
			else{
				printf("YES\n");
			}
		}
		else{
			printf("NO\n");
		}
	}
	free(tests);
	return 0;

}


#include<stdio.h>
#include<stdlib.h>
int main()
{

 int a,b ,c,n,t,i,ch;
 scanf("%d",&t);
 for(i=0;i<t;i++){
 	scanf("%d%d%d%d",&a,&b,&c,&n);
 	if(a>=b&&a>c){
 	ch=n-((a-b)+(a-c));
 	if(ch%3==0)printf("YES\n");
 	else printf("NO\n");
 	continue;
	 }
	if(b>=a&&b>c){
 	ch=n-((b-a)+(b-c));
 	if(ch%3==0)printf("YES\n");
 	else printf("NO\n");
 	continue;
	 }
	 	if(c>=b&&c>a){
 	ch=n-((c-a)+(c-b));
 	if(ch%3==0)printf("YES\n");
 	else printf("NO\n");
 	continue;
	 }
	 if(a=b=c){
	 	if(n%3==0)printf("YES\n");
	 	else printf("NO\n");
	 }

 }

}


#include<stdio.h>
#include<stdlib.h>
int main()
{
    int n,a,b,c,i,j;
    int *input;
    int given,store[10][10];
    scanf("%d",&n);
    input=malloc(n*sizeof(float));
    for(i=0;i<n;i++){
        for(j=0;j<4;j++){
                scanf("%d",&input[j]);
                store[i][j]=input[j];

        }
    }
      for(i=0;i<n;i++){
      	j=0;
      	if(store[i][j]>store[i][j+1]&&store[i][j]>store[i][j+2]){
      		a=store[i][j]-store[i][j+1];
      		b=store[i][j]-store[i][j+2];
      		store[i][3]=store[i][3]-(a+b);
		  }
       	if(store[i][j+1]>store[i][j]&&store[i][j+1]>store[i][j+2]){
      		a=store[i][j+1]-store[i][j];
      		b=store[i][j+1]-store[i][j+2];
      		store[i][3]=store[i][3]-(a+b);
		  }
		    	if(store[i][j+2]>store[i][j]&&store[i][j+2]>store[i][j+1]){
      		a=store[i][j+2]-store[i][j];
      		b=store[i][j+2]-store[i][j+1];
      		store[i][3]=store[i][3]-(a+b);
		  }
		  if(store[i][3]%3==0){
		  	printf("YES\n");
		  }
		  else printf("NO\n");

    }

}


#include<stdio.h>
#include<stdlib.h>
int main()
{
	int t,a,b,c,n,i,sum=0;
	scanf("%d",&t);
	for(i=0;i<t;i++){
		scanf("%d%d%d%d",&a,&b,&c,&n);
		sum=a+b+c+n;
		if((sum%3==0)&&(sum/3>=a)&&(sum/3>=b)&&(sum/3>=c)){
			printf("YES\n");
		}
		else printf("NO\n");
	}
}


#include<stdio.h>
#include<stdlib.h>
int main()
{
	int t,a,b,c,n,i,sum=0;
	scanf("%d",&t);
	for(i=0;i<t;i++){
		scanf("%d%d%d%d",&a,&b,&c,&n);
		sum=a+b+c+n;
		if(sum%3==0&&sum/3>=a&&sum>=b&&sum>=c){
			printf("YES\n");
		}
		else printf("NO\n");
	}
}


#include<stdio.h>
#include<stdlib.h>
int main()

{
   int a,b ,c,n,t,i,ch;
   scanf("%d",&t);
 for(i=0;i<t;i++){
 	scanf("%d%d%d%d",&a,&b,&c,&n);
 	if(a>=b&&a>c){
 	ch=abs(n-((a-b)+(a-c)));
 	if(n>ch&&ch%3==0)printf("YES\n");
 	else printf("NO\n");
 	 }
else if(b>=a&&b>c){
 	ch=abs(n-((b-a)+(b-c)));
 	if(n>ch&&ch%3==0)printf("YES\n");
 	else printf("NO\n");
     }
	 else if(c>=b&&c>a){
 	ch=abs(n-((c-a)+(c-b)));
 	if(n>ch&&ch%3==0)printf("YES\n");
 	else printf("NO\n");
    }
else if(a=b=c){
	 	if(n%3==0)printf("YES\n");
	 	else printf("NO\n");
	 }

 }
}


#include <stdio.h>

int main()
{
    int a,b,c,n,t;
    scanf("%d",&t);

    while(t>0)
    {
        scanf("%d %d %d %d",&a,&b,&c,&n);
        if(a==b && a==c && b==c)
        {
            if(n<=3)
            printf("YES\n");

            else
            {
                if(n%3 == 0)
                    printf("YES\n");
                else
                    printf("NO\n");
            }
        }
        else
        {
            if((a+b+c+n)%3==0)
                printf("YES\n");
            else
                printf("NO\n");
        }
        t--;
    }
    return 0;
}


#include <stdio.h>

int main()
{
    int a,b,c,n,t;
    scanf("%d",&t);

    while(t>0)
    {
        scanf("%d %d %d %d",&a,&b,&c,&n);
        if(a==b && a==c && b==c)
        {
            printf("YES\n");
        }
        else
        {
            if((a+b+c+n)%3==0)
                printf("YES\n");
            else
                printf("NO\n");
        }
        t--;
    }
    return 0;
}


#include <stdio.h>

int main()
{
    int a,b,c,n,t;
    scanf("%d",&t);

    while(t>0)
    {
        scanf("%d %d %d %d",&a,&b,&c,&n);
        if(a==b && a==c && b==c)
        {
            if(n<=3)
            printf("YES\n");

            else
            {
                if(n%3 == 0)
                    printf("YES");
                else
                    printf("NO");
            }
        }
        else
        {
            if((a+b+c+n)%3==0)
                printf("YES\n");
            else
                printf("NO\n");
        }
        t--;
    }
    return 0;
}


#include <stdio.h>

int main()
{
    int t,a,b,c,n,max,val;
    scanf("%d",&t);
    while(t>0)
    {
        scanf("%d %d %d %d",&a,&b,&c,&n);
        if(a==b && b==c && a==c)
        {
            if(n%3==0)
                printf("YES\n");
            else if(n==0)
                printf("YES");
            else
                printf("NO\n");
        }
        else
        {
            max = ((a>b && a>c)?a:(b>c?b : c));

            val = (n-((max-a)+(max-b)+(max-c)));

            if(val>=0)
            {
                if((val)%3==0)
                    printf("YES\n");
                else
                    printf("NO\n");
            }
            else
                printf("NO\n");
        }
        t--;
    }
	return 0;
}


#include <stdio.h>

int main()
{
    int a,b,c,n,t;
    scanf("%d",&t);

    while(t>0)
    {
        scanf("%d %d %d %d",&a,&b,&c,&n);
        if(a==b && a==c && b==c)
        {
            if(n%3==0)
                printf("YES\n");
        }
        else
        {
            if((a+b+c+n)%3==0)
                printf("YES\n");
            else
                printf("NO\n");
        }
        t--;
    }
    return 0;
}


#include <stdio.h>

int main ()
{
    int i, t;
    long long int a, b, c, n, temp;

    scanf("%d", &t);

    for (i = 1; i <= t; i++){
        scanf("%lld %lld %lld %lld", &a, &b, &c, &n);

        if(a > b){
            temp = a;
            a = b;
            b = temp;
            if (a > c){
                temp = a;
                a = c;
                c = temp;
            }
        }
        else {
            if (b > c){
                temp = b;
                b = c;
                c = temp;
            }
        }
        if (2*c - a - b <= n && (n - (2*c - a - b)) % 3 == 0){
            printf("YES\n");
        }
        else {
            printf("NO\n");
        }
    }

    return 0;
}


#include <stdio.h>

int main ()
{
    long long int i, a, b, c, n, t, temp;

    scanf("%d", &t);

    for (i = 1; i <= t; i++){
        scanf("%lld %lld %lld %lld", &a, &b, &c, &n);

        if(a > b){
            temp = a;
            a = b;
            b = temp;
            if (a > c){
                temp = a;
                a = c;
                c = temp;
            }
        }
        else {
            if (b > c){
                temp = b;
                b = c;
                c = temp;
            }
        }
        if (2*c - a - b <= n && (n - (2*c - a - b)) % 3 == 0){
            printf("YES\n");
        }
        else {
            printf("NO\n");
        }
    }

    return 0;
}


#include <stdio.h>

int main ()
{
    int i, a, b, c, n, t, temp;

    scanf("%d", &t);

    for (i = 1; i <= t; i++){
        scanf("%d %d %d %d", &a, &b, &c, &n);

        if(a > b){
            temp = a;
            a = b;
            b = temp;
            if (a > c){
                temp = a;
                a = c;
                c = temp;
            }
        }
        else {
            if (b > c){
                temp = b;
                b = c;
                c = temp;
            }
        }
        if (2*c - a - b <= n && (n - (2*c - a - b)) % 3 == 0){
            printf("YES\n");
        }
        else {
            printf("NO\n");
        }
    }

    return 0;
}


#include <stdio.h>

int main ()
{
    int i, t;
    long long int a, b, c, n, temp;

    scanf("%d", &t);

    for (i = 1; i <= t; i++){
        scanf("%lld %lld %lld %lld", &a, &b, &c, &n);

        if(a > b){
            temp = a;
            a = b;
            b = temp;
            if (a > c){
                temp = a;
                b = c;
                c = temp;
            }
            if (a > b){
                temp = a;
                a = b;
                b = temp;
            }
        }
        else {
            if (b > c){
                temp = b;
                b = c;
                c = temp;
            }
        }
        if (2*c - a - b <= n && (n - (2*c - a - b)) % 3 == 0){
            printf("YES\n");
        }
        else {
            printf("NO\n");
        }
    }

    return 0;
}


#include <stdio.h>

int main ()
{
    int i, t;
    long long int a, b, c, n, temp;

    scanf("%d", &t);

    for (i = 1; i <= t; i++){
        scanf("%lld %lld %lld %lld", &a, &b, &c, &n);

        if (a > b){
            temp = a;
            a = b;
            b = temp;
            if (b > c){
                temp = b;
                b = c;
                c = temp;
                if (a > b){
                    temp = a;
                    a = b;
                    b = temp;
                }
            }
        }
        else if (b > c){
            temp = b;
            b = c;
            c = temp;
        }
        if (2*c - a - b <= n && (n - (2*c - a - b)) % 3 == 0){
            printf("YES\n");
        }
        else {
            printf("NO\n");
        }
    }

    return 0;
}


#include<stdio.h>
#include<math.h>

int max(int a,int b){
	if(a>b)
	return a;
	else
	return b;
}
int main(){
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		int a,b,c,n;
		scanf("%d%d%d%d",&a,&b,&c,&n);
		if(a==b&&b==c){
			if(n%3==0)
			printf("YES\n");
			else
			printf("NO\n");
		}
		else if(((a+b+c+n)%3==0)&&n>=max(a,max(b,c)))
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


#include<stdio.h>
#include<math.h>

int max(int a,int b){
	if(a>b)
	return a;
	else
	return b;
}
int main(){
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		int a,b,c,n;
		scanf("%d%d%d%d",&a,&b,&c,&n);
		if(a==b&&b==c){
			if(n%3==0)
			printf("YES\n");
			else
			printf("NO\n");
		}
		else if(((a+b+c+n)%3==0)&&((n>=(a+b)||n>=(a+c)||n>=(b+c))||(a+b>=n||a+c>=n||b+c>=n)))
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


#include<stdio.h>
#include<math.h>

int max(int a,int b){
	if(a>b)
	return a;
	else
	return b;
}
int main(){
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		int a,b,c,n;
		scanf("%d%d%d%d",&a,&b,&c,&n);
		if(a==b&&b==c){
			if(n%3==0)
			printf("YES");
			else
			printf("NO");
		}
		else if(((a+b+c+n)%3==0)&&n>max(a,max(b,c)))
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


#include<stdio.h>
#include<math.h>

int max(int a,int b){
	if(a>b)
	return a;
	else
	return b;
}
int main(){
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		int a,b,c,n;
		scanf("%d%d%d%d",&a,&b,&c,&n);
		if(a==b&&b==c){
			if(n%3==0)
			printf("YES\n");
			else
			printf("NO\n");
		}
		else if(((a+b+c+n)%3==0)&&(a+b>=n||a+c>=n||b+c>=n))
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


#include<stdio.h>
#include<math.h>

int max(int a,int b){
	if(a>b)
	return a;
	else
	return b;
}
int main(){
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		int a,b,c,n;
		scanf("%d%d%d%d",&a,&b,&c,&n);
/*		if(a==b&&b==c){
			if(n%3==0)
			printf("YES\n");
			else
			printf("NO\n");
		}*/
		int sum=a+b+c+n;
		if(sum%3==0&&a<=sum/3&&b<=sum/3&&c<=sum/3)
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


#include<stdio.h>
#include<math.h>

int max(int a,int b){
	if(a>b)
	return a;
	else
	return b;
}
int main(){
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		int a,b,c,n;
		scanf("%d%d%d%d",&a,&b,&c,&n);
		if(a==b&&b==c){
			if(n%3==0)
			printf("YES\n");
			else
			printf("NO\n");
		}
		else if(((a+b+c+n)%3==0)&&n>max(a,max(b,c)))
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


#include<stdio.h>
#include<math.h>

int max(int a,int b){
	if(a>b)
	return a;
	else
	return b;
}
int main(){
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		int a,b,c,n;
		scanf("%d%d%d%d",&a,&b,&c,&n);
		if(a==b&&b==c){
			if(n%3==0)
			printf("YES\n");
			else
			printf("NO\n");
		}
		else if(((a+b+c+n)%3==0)||(n>=(a+b)||n>=(a+c)||n>=(b+c))&&(a+b>=n||a+c>=n||b+c>=n))
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


#include<stdio.h>
#include<math.h>

int max(int a,int b){
	if(a>b)
	return a;
	else
	return b;
}
int main(){
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		int a,b,c,n;
		scanf("%d%d%d%d",&a,&b,&c,&n);
		if(a==b&&b==c){
			if(n%3==0)
			printf("YES\n");
			else
			printf("NO\n");
		}
		else if(((a+b+c+n)%3==0)&&(n>=(a+b)||n>=(a+c)||n>=(b+c))&&(a+b>=n||a+c>=n||b+c>=n))
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


#include<stdio.h>
#include<math.h>

int main(){
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		int a,b,c,n;
		scanf("%d%d%d%d",&a,&b,&c,&n);
		if((a+b+c+n)%3==0)
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


#include<stdio.h>
#include<math.h>

int max(int a,int b){
	if(a>b)
	return a;
	else
	return b;
}
int main(){
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		int a,b,c,n;
		scanf("%d%d%d%d",&a,&b,&c,&n);
		if(((a+b+c+n)%3==0)&&n>max(a,max(b,c)))
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


#include <stdio.h>

int main()
{
    int t;
    scanf("%d", &t);
    while(t--)
    {
        int a, b, c, n;
        scanf("%d%d%d%d", &a, &b, &c, &n);
        int avg = 0 ;
        if((a+b+c+n) % 3 != 0)
        {
            printf("NO\n");
            continue;
        }
        else
        {
            avg = (a+b+c+n)/3;
        }
        if(avg*3 - a - b - c == n)
        {
            if(avg >= a && avg >=b && avg >= c)
            {
                    printf("YES\n");
            }
        }
        else
        {
            printf("NO\n");
        }
    }
}


#include <stdio.h>

int main()
{
    int t;
    scanf("%d", &t);
    while(t--)
    {
        int a, b, c, n;
        scanf("%d%d%d%d", &a, &b, &c, &n);
        int avg = 0 ;
        if((a+b+c+n) % 3 == 0)
        {
            printf("NO");
            continue;
        }
        else
        {
            avg = (a+b+c+n)/3;
        }
        if(avg*3 - a - b - c == n)
        {
            if(avg >= a && avg >=b && avg >= c)
            {
                    printf("YES\n");
            }
        }
        else
        {
            printf("NO\n");
        }
    }
}


#include <stdio.h>

int main()
{
    int t;
    scanf("%d", &t);
    while(t--)
    {
        int a, b, c, n;
        scanf("%d%d%d%d", &a, &b, &c, &n);
        int avg = 0 ;
        printf("%d", a+b+c+n);
        if((a+b+c+n) % 3 != 0)
        {
            printf("NO\n");
            continue;
        }
        else
        {
            avg = (a+b+c+n)/3;
        }
        if(avg*3 - a - b - c == n)
        {
            if(avg >= a && avg >=b && avg >= c)
            {
                    printf("YES\n");
            }
        }
        else
        {
            printf("NO\n");
        }
    }
}


#include <stdio.h>

int main()
{
    int t;
    scanf("%d", &t);
    while(t--)
    {
        int a, b, c, n;
        scanf("%d%d%d%d", &a, &b, &c, &n);
        int avg = (a+b+c+n) / 3;
        if(avg*3 - a - b - c == n)
        {
            if(avg >= a && avg >=b && avg >= c)
            {
                    printf("YES\n");
            }
        }
        else
        {
            printf("NO\n");
        }
    }
}


#include <stdio.h>

int main()
{
    int t;
    scanf("%d", &t);
    while(t--)
    {
        int a, b, c, n;
        scanf("%d%d%d%d", &a, &b, &c, &n);
        int avg = (a+b+c+n) / 3;
        if(avg*3 - a - b - c == n)
        {
            printf("YES\n");
        }
        else
        {
            printf("NO\n");
        }
    }
}


#include <stdio.h>

int main()
{
    int t;
    scanf("%d", &t);
    while(t--)
    {
        int a, b, c, n;
        scanf("%d%d%d%d", &a, &b, &c, &n);
        int avg = 0 ;
        if((a+b+c+n) % 3 != 0)
        {
            printf("NO\n");
            continue;
        }
        else
        {
            avg = (a+b+c+n)/3;
        }
        if(avg*3 - a - b - c == n)
        {
            if(avg >= a && avg >=b && avg >= c)
            {
                printf("YES\n");
            }
            else
            {
                printf("NO\n");
            }
        }
    }
}


#include <stdio.h>

int main()
{
    int t;
    scanf("%d", &t);
    while(t--)
    {
        int a, b, c, n;
        scanf("%d%d%d%d", &a, &b, &c, &n);
        int avg = 0 ;
        printf("%d", a+b+c+n);
        if((a+b+c+n) % 3 != 0)
        {
            printf("NO\n");
            continue;
        }
        else
        {
            avg = (a+b+c+n)/3;
        }
        if(avg*3 - a - b - c == n)
        {
            if(avg >= a && avg >=b && avg >= c)
            {
                printf("YES\n");
            }
            else
            {
                printf("NO\n");
            }
        }
    }
}


#include<stdio.h>
#include<stdlib.h>

int main()
{
    int t;
    scanf("%d", &t);
    while(t--) {
        int a, b, c, n;
        scanf("%d %d %d %d", &a, &b, &c, &n);
        if(2 * a - b - c == 0) {
            printf("YES\n");
        }
        else {
            int A = (n - (2 * a - b - c)) / 3;

            if(A * 3 + (2 * a - b - c) == n) {
                printf("YES\n");
            }
            else {
                printf("NO\n");
            }
        }
    }
    return 0;
}


#include<stdio.h>
#include<stdlib.h>

int main()
{
    int t;
    scanf("%d", &t);
    while(t--) {
        int a, b, c, n;
        scanf("%d %d %d %d", &a, &b, &c, &n);
        if(2 * a - b - c == 0) {
            printf("YES\n");
        }
        else {
            int A = (n - (2 * a - b - c)) / 3;

            if(A * 3 + (2 * a - b - c) == n) {
                printf("YES");
            }
            else {
                printf("NO\n");
            }
        }
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void test() {
    int a, b, c, n;
    scanf("%d %d %d %d", &a, &b, &c, &n);

    int A, B, C;

    if((a + b - 2 * c + n) >= 0 && (a + b - 2 * c + n) % 3 == 0) {       // C
        C = (a + b - 2 * c + n) / 3;
    }
    else {
        printf("NO\n");
        return;
    }

    if((a - b + n - C) >= 0 && (a - b + n - C) % 2 == 0) {       // B
        B = (a - b + n - C) / 2;
    }
    else {
        printf("NO\n");
        return;
    }

    if(n - B - C >= 0) {       // A
        A = n - B - C;
    }
    else {
        printf("NO\n");
        return;
    }

    printf("YES\n");
}

int main ()
{
    int t;
    scanf("%d", &t);
    while(t--) {
        test();
    }
    return 0;
}


#include<stdio.h>
#include<stdlib.h>

int main()
{
    int t;
    scanf("%d", &t);
    while(t--) {
        int a, b, c, n;
        scanf("%d %d %d %d", &a, &b, &c, &n);
        if(2 * a - b - c == 0 && n % 3 == 0) {
            printf("YES\n");
        }
        else {
            int A = (n - (2 * a - b - c)) / 3;

            if(A * 3 + (2 * a - b - c) == n) {
                printf("YES\n");
            }
            else {
                printf("NO\n");
            }
        }
    }
    return 0;
}


#include<stdio.h>
#include<stdlib.h>

int main()
{
    int t;
    scanf("%d", &t);
    while(t--) {
        int a, b, c, n;
        scanf("%d %d %d %d", &a, &b, &c, &n);
        if(2 * a - b - c == 0 && n % 3 == 0) {      //if a = b = c
            printf("YES\n");
        }
        else if(2 * a - b - c == 0 && n % 3 != 0) {
            printf("NO\n");
        }
        else if(2 * a - b - c != 0){
            int A = (n - (2 * a - b - c)) / 3;

            if(A * 3 + (2 * a - b - c) == n) {
                printf("YES\n");
            }
            else {
                printf("NO\n");
            }
        }
    }
    return 0;
}


#include<stdio.h>
int main()
{
	int d[10000],i,j,a,b,c,n,p,t;
	scanf("%d",&t);
	for(i=0;i<t;i++)
	{
		scanf("%d%d%d%d",&a,&b,&c,&n);
		int k =comp(a,b,c);
		int j=(k-a)+(k-b)+(k-c);
		if(j<=n)
		{
		p=(a+b+c+n)%3;
		if(p==0)
		{
			d[i]=1;
		}
		else
		{
			d[i]=0;
		}
	   }
	   else
	   d[i]=0;
	}
	for(j=0;j<t;j++)
	{
		if(d[j]==1)
		printf("YES");
		else
		printf("NO");
		printf("\n");
	}
	return 0;
}
int comp(int a,int b,int c)
{
     if (a >= b && a >= c)
       return a;

    else if (b >= a && b >= c)
        return b;

    else if (c >= a && c >= b)
       return c;
  }


#include<stdio.h>
int main()
{
	int d[10000],i,j,a,b,c,n,p,t;
	scanf("%d",&t);
	for(i=0;i<t;i++)
	{
		scanf("%d%d%d%d",&a,&b,&c,&n);
		int k =comp(a,b,c);
		int j=(k-a)+(k-b)+(k-c);
		if(j<n)
		{
		p=(a+b+c+n)%3;
		if(p==0)
		{
			d[i]=1;
		}
		else
		{
			d[i]=0;
		}
	   }
	   else
	   d[i]=0;
	}
	for(j=0;j<t;j++)
	{
		if(d[j]==1)
		printf("YES");
		else
		printf("NO");
		printf("\n");
	}
	return 0;
}
int comp(int a,int b,int c)
{
     if (a >= b && a >= c)
       return a;

    else if (b >= a && b >= c)
        return b;

    else if (c >= a && c >= b)
       return c;
  }


#include<stdio.h>
int main()
{
      long long int t,a,b,c,n,d;
      scanf("%lld",&t);
      while(t--){
             scanf("%lld %lld %lld %lld",&a,&b,&c,&n);
             d=(a>b)?(a>c)?a:c:(b>c)?b:c;
             d=(d-a)+(d-b)+(d-c);
             if((n-d)%3==0) printf("YES\n");
             else printf("NO\n");
      }
      return 0;
}


#include<stdio.h>
int main()
{
      long long int t,a,b,c,n,d;
      scanf("%lld",&t);
      while(t--){
             scanf("%lld %lld %lld %lld",&a,&b,&c,&n);
             d=(a>b)?(a>c)?a:c:(b>c)?b:c;
             n=n+a+b+c-(3*d);
             if(n>=0&&n%3==0) printf("YES\n");
             else printf("NO\n");
      }
      return 0;
}


#include<stdio.h>
int main()
{
      long long int t,a,b,c,n,d;
      scanf("%lld",&t);
      while(t--){
             scanf("%lld %lld %lld %lld",&a,&b,&c,&n);
             d=(a>b)?(a>c)?a:c:(b>c)?b:c;
             d=(d-a)+(d-b)+(d-c);
             if(n>d&&(n-d)%3==0) printf("YES\n");
             else printf("NO\n");
      }
      return 0;
}


#include<stdio.h>
int main()
{
      long long int t,a,b,c,n,d;
      scanf("%lld",&t);
      while(t--){
             scanf("%lld %lld %lld %lld",&a,&b,&c,&n);
             d=(a>b)?(a>c)?a:c;(b>c)?b:c;
             d=(d-a)+(d-b)+(d-c);
             if((n-d)%3==0) printf("YES");
             else printf("NO");
      }
      return 0;
}


#include<stdio.h>
int main()
{
      long long int t,a,b,c,n,d;
      scanf("%lld",&t);
      while(t--){
             scanf("%lld %lld %lld %lld",&a,&b,&c,&n);
             d=(a>b)?(a>c)?a:c:(b>c)?b:c;
             d=(d-a)+(d-b)+(d-c);
             if(d>=n) printf("YES\n");
             else printf("NO\n");
      }
      return 0;
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;

public class P266C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(in, out);
		out.close();
	}

	static class Task {

		private class Triplet {
			int x, y, z;

			public Triplet(int x, int y, int z) {
				this.x = x;
				this.y = y;
				this.z = z;
			}

			@Override
			public String toString() {
				return x + " " + y + " " + z;
			}

		}

		private class Pair {
			int x, y;

			public Pair(int x, int y) {
				this.x = x;
				this.y = y;
			}

			@Override
			public String toString() {
				return x + " " + y;
			}

			@Override
			public int hashCode() {
				final int prime = 31;
				int result = 1;
				result = prime * result + x;
				result = prime * result + y;
				return result;
			}

			@Override
			public boolean equals(Object obj) {
				Pair other = (Pair) obj;
				if (x != other.x)
					return false;
				if (y != other.y)
					return false;
				return true;
			}

		}

		public void solve(InputReader in, PrintWriter out) {
			int n = in.nextInt();
			int[] rc = new int[n + 1];
			int[] cc = new int[n + 1];
			Set<Pair> matrix = new HashSet<>();
			int[] swapR = new int[n + 1];
			int[] swapC = new int[n + 1];
			for (int i = 1; i <= n; i++) {
				swapR[i] = i;
				swapC[i] = i;
			}
			for (int i = 0; i < n - 1; i++) {
				int r = in.nextInt();
				int c = in.nextInt();
				rc[r]++;
				cc[c]++;
				matrix.add(new Pair(r, c));
			}
			List<Triplet> sol = new ArrayList<>();
			// loop over size of matrix
			for (int i = n; i > 1; i--) {
				// finding empty column
				int ec = i;
				if (cc[i] != 0) {
					for (int j = 1; j < i; j++) {
						if (cc[j] == 0) {
							ec = j;
							break;
						}
					}
					// swap to rightmost
					// dont care about cc[i]
					sol.add(new Triplet(2, ec, i));
					cc[ec] = cc[i];
					swapC[ec] = i;
				}
				// finding row with atleast one 1
				int nr = i;
				for (int j = 1; j < i; j++) {
					if (rc[j] > 0) {
						nr = j;
						break;
					}
				}
				if (nr != i) {
					// swap to bottommost
					// dont care about rc[i]
					sol.add(new Triplet(1, nr, i));
					rc[nr] = rc[i];
					// remove ones
					for (int j = 1; j < i; j++) {
						cc[j] -= matrix.contains(new Pair(swapR[nr], swapC[j])) ? 1 : 0;
					}
					swapR[nr] = i;
				}
			}
			out.println(sol.size());
			for (Triplet t : sol) {
				out.println(t);
			}
		}

	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.StringTokenizer;

public class P266C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(in, out);
		out.close();
	}

	static class Task {
		private class Pair {
			int x, y;

			public Pair(int x, int y) {
				this.x = x;
				this.y = y;
			}

			@Override
			public String toString() {
				return "(" + x + ", " + y + ")";
			}

			@Override
			public int hashCode() {
				final int prime = 31;
				int result = 1;
				result = prime * result + x;
				result = prime * result + y;
				return result;
			}

			@Override
			public boolean equals(Object obj) {
				Pair other = (Pair) obj;
				if (x != other.x)
					return false;
				if (y != other.y)
					return false;
				return true;
			}
		}

		private class Triplet {
			int x, y, z;

			public Triplet(int x, int y, int z) {
				this.x = x;
				this.y = y;
				this.z = z;
			}

			@Override
			public String toString() {
				return x + " " + y + " " + z;
			}

		}

		private List<Pair> swapRow(Pair test, Pair empty, Map<Pair, Boolean> matrix, List<Pair> ones,
				Set<Pair> invalid) {
			int a = test.x, b = empty.x;
			List<Pair> newOnes = new ArrayList<>();
			for (Pair p : ones) {
				boolean changed = false;
				Pair loc = p;
				if (p.x == a) {
					changed = true;
					loc = new Pair(b, p.y);
				} else if (p.x == b) {
					changed = true;
					loc = new Pair(a, p.y);
				}
				newOnes.add(loc);
				if (changed) {
					matrix.put(loc, true);
					matrix.remove(p);
				}
			}
			return newOnes;
		}

		private List<Pair> swapColumn(Pair test, Pair empty, Map<Pair, Boolean> matrix, List<Pair> ones,
				Set<Pair> invalid) {
			int a = test.y, b = empty.y;
			List<Pair> newOnes = new ArrayList<>();
			for (Pair p : ones) {
				boolean changed = false;
				Pair loc = p;
				if (p.y == a) {
					changed = true;
					loc = new Pair(p.x, b);
				} else if (p.y == b) {
					changed = true;
					loc = new Pair(p.x, a);
				}
				newOnes.add(loc);
				if (changed) {
					matrix.put(loc, true);
					matrix.remove(p);
				}
			}
			return newOnes;
		}

		private void fixInvalid(Map<Pair, Boolean> matrix, Set<Pair> invalid) {
			invalid.clear();
			for (Pair p : matrix.keySet()) {
				if (matrix.get(p) && p.x <= p.y) {
					invalid.add(p);
				}
			}
		}

		public void solve(InputReader in, PrintWriter out) {
			int n = in.nextInt();
			Map<Pair, Boolean> matrix = new HashMap<>();
			Set<Pair> invalid = new HashSet<>();
			List<Pair> ones = new ArrayList<>();
			for (int i = 0; i < n - 1; i++) {
				int r = in.nextInt();
				int c = in.nextInt();
				Pair loc = new Pair(r, c);
				ones.add(loc);
				matrix.put(loc, true);
				if (r <= c) {
					invalid.add(loc);
				}
			}
			List<Triplet> sol = new ArrayList<>();
			Random r = new Random();
			while (invalid.size() > 0) {
				Pair empty = new Pair(0, 0);
				do {
					int i = 2 + r.nextInt(n - 1);
					int j = 1 + r.nextInt(i - 1);
					empty.x = i;
					empty.y = j;
				} while (matrix.getOrDefault(empty, false));
				Pair test = invalid.iterator().next();
				if (test.x != empty.x) {
					sol.add(new Triplet(1, test.x, empty.x));
					ones = swapRow(test, empty, matrix, ones, invalid);
				}
				if (test.y != empty.y) {
					sol.add(new Triplet(2, test.y, empty.y));
					ones = swapColumn(test, empty, matrix, ones, invalid);
				}
				fixInvalid(matrix, invalid);
			}
			out.println(sol.size());
			for (Triplet t : sol) {
				out.println(t);
			}
		}

	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}

	}

}


import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Double.parseDouble;
import static java.lang.String.*;

public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                                            //(new FileReader("input.in"));
        StringBuilder out = new StringBuilder();
        StringTokenizer tk;
        //PrintWriter pw = new PrintWriter("output.out", "UTF-8");

        int n = parseInt(in.readLine());
        point [] one = new point[n-1];

        for(int i=0; i<one.length; i++) {
            tk = new StringTokenizer(in.readLine());
            one[i] = new point(parseInt(tk.nextToken()),parseInt(tk.nextToken()));
        }

        int cnt = 0;

        while(n > 1) {
            int [] col = new int[n+1];
            for(int i=0; i<one.length; i++)
                if(one[i].r<=n && one[i].c<=n)
                    col[one[i].c]++;

            int e = 0;
            for(int i=1; i<=n; i++)
                if(col[i]==0) {
                    e = i;
                    break;
                }

            if(e!=n && e>0) {
                for(int i=0; i<one.length; i++)
                    if(one[i].c==n)
                        one[i].c = e;
                    else if(one[i].c==e)
                        one[i].c = n;

                out.append("2 ").append(e).append(" ").append(n).append("\n");
                cnt++;
            }

            int [] row = new int[n+1];
            for(int i=0; i<one.length; i++)
                if(one[i].c<=n && one[i].r<=n)
                    row[one[i].r]++;

            e = 0;
            for(int i=1; i<=n; i++)
                if(row[i]>0) {
                    e = i;
                    break;
                }

            if(e!=n && e>0) {
                for(int i=0; i<one.length; i++)
                    if(one[i].r==e)
                        one[i].r = n;
                    else if(one[i].r==n)
                        one[i].r = e;

                out.append("1 ").append(e).append(" ").append(n).append("\n");
                cnt++;
            }

            n--;
        }

        System.out.println(cnt);
        System.out.print(out);
    }

}

class point {
    int r,c;

    public point(int r,int c) {
        this.r = r;
        this.c = c;
    }
}