#include <bits/stdc++.h>
using namespace std;
#define int long long
#define F(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define R(i,b,a) for(int i=(int)(b);i>=(int)(a);i--)
#define endl "\n"
#define ios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define out(x) cout<<setprecision(15)<<x<<endl,exit(0)
#define pii pair<int,int>
#define pb push_back
#define all(v) v.begin(),v.end()
#define I first
#define S second
#define ld long double
ld pi=3.14159265359;

const int N=1e5+9;
int n,m,vis[N],ans[N];
vector <pii> v[N];

int slv(int x){
	x++;
	if(x>n) x=1;
	return x;
}

void dfs(int x,int prv){
	ans[x]=prv;
	vis[x]=1;
	for(auto it:v[x]){
		if(vis[it.I]) continue;
		if(it.S==prv) dfs(it.I,slv(prv));
		else dfs(it.I,it.S);
	}
}

int32_t main(){
   ios;
   cin>>n>>m;
   F(i,1,m){
   	int x,y,w;
   	cin>>x>>y>>w;
   	v[x].pb({y,w});
   	v[y].pb({x,w});
   }

   dfs(1,1);
   F(i,1,n) cout<<ans[i]<<endl;
} 

#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>
#define pi 2*acos(0.0)

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)
 
// debug templates 
#define debug(x)       cerr<< #x <<" : "<< x << endl;
#define debuga(A,N)    cerr<< #A <<" : [";for(int i = 0; i<N;i++) cerr<<A[i]<<" "; cerr<<"]\n";
#define debuga2(A,N,M) cerr<< #A << " : \n"; for(int i=0;i<N;i++){cerr<<"[";for(int j=0;j<M;++j) cerr<<A[i][j]<<" ";cerr<<"]\n";}
#define debugp(p)      cerr<< #p <<" : "<<"("<<(p).first<<","<<(p).second<<")\n";
#define debugv(v)      cerr<< #v <<" : "<<"[";for(int i = 0; i< (v).size(); i++) cerr<<v[i]<<" "; cerr<<"]\n";
#define debugv2(v)     cerr<< #v << " : \n"; for(int i=0;i<v.size();i++){cerr<<"[";for(int j=0;j<(v[0].size());++j) cerr<<v[i][j]<<" ";cerr<<"]\n";}
#define debugs(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin(); itr!=m.end();itr++) cerr<<*itr<<" "; cerr<<"]\n";
#define debugm(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin();itr!=m.end(); itr++) cerr<<"("<<itr->first<<","<<itr->second<<") ";cerr<<"]\n";

const int mxN = 107;
double dp[mxN][mxN][mxN];

double prob(int a, int b, int c){
    if(a>99 || b>99 || c>99) return 0;
    if(dp[a][b][c]>=0) return dp[a][b][c];
    double s=a+b+c;
    dp[a][b][c] = 1+prob(a+1,b,c)*a/s+prob(a,b+1,c)*b/s+prob(a,b,c+1)*c/s;
    return dp[a][b][c];
}

// solve case for 2 then do 3
void solve(){
    int a,b,c; cin >> a >> b >> c;
    memset(dp,-1,sizeof(dp));
    double ans = prob(a,b,c);
    cout << fixed << setprecision(9) << ans;    
}
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	solve();
	return 0;
}
 
