#include <bits/stdc++.h>
using namespace std;
const int N = 101;
vector<pair<int, int>> g[N];
void dfs(int v, double dis, bool dw, int par = -1) {
  double d = 2.0 / (int)g[v].size();
  dw ^= true;
  for (auto x : g[v]) {
    int u = x.first;
    if (u - par) {
      double cd = d;
      double mini = min(1.0 - dis, cd);
      if (mini < 1 - dis)
        dis += mini;
      else {
        cd -= mini;
        dis = cd;
        dw ^= true;
      }
      cout << 1 << ' ' << x.second + 1 << ' ';
      if (dw)
        cout << v + 1 << ' ' << u + 1 << ' ';
      else
        cout << u + 1 << ' ' << v + 1 << ' ';
      cout << dis << endl;
      dfs(u, dis, dw, v);
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    g[u].push_back({v, i});
    g[v].push_back({u, i});
  }
  cout << n - 1 << endl;
  cout << fixed << setprecision(6);
  dfs(0, 0.0, false, -1);
}
