#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const double eps = 1e-10;
const int N = 110;
int n;
vector<vector<pair<int, int> > > g;
int from[N], to[N];
double d[N];
double inc(double x) {
  x += 1;
  if (x >= 2) x -= 2;
  return x;
}
void dfs(int u, int fa, double up) {
  int deg = g[u].size();
  int id = 1;
  for (int i = 0; i < deg; i++) {
    int v = g[u][i].first, t = g[u][i].second;
    if (v == fa) continue;
    double tmp = up + id * 2.0 / deg;
    if (tmp >= 2) tmp -= 2;
    id++;
    if (tmp < 1) {
      from[t] = u;
      to[t] = v;
      d[t] = tmp;
    } else {
      from[t] = v;
      to[t] = u;
      d[t] = inc(tmp);
    }
    dfs(v, u, inc(tmp));
  }
}
void solve() {
  dfs(1, -1, 0);
  cout << n - 1 << endl;
  for (int i = 0; i < n - 1; i++) {
    printf("1 %d %d %d %.8f\n", i + 1, from[i], to[i], d[i]);
  }
}
int main() {
  while (cin >> n) {
    g.clear();
    g.resize(n + 1);
    int u, v;
    for (int i = 0; i < n - 1; i++) {
      scanf("%d %d", &u, &v);
      g[u].push_back(make_pair(v, i));
      g[v].push_back(make_pair(u, i));
    }
    solve();
  }
  return 0;
}
