#include <bits/stdc++.h>
using namespace std;
const int NMAX = 100;
vector<pair<int, int> > g[NMAX + 1];
void dfs(int u, int p, double offset) {
  int d = g[u].size();
  double delta = 2. / d;
  double cur = offset;
  for (auto e : g[u])
    if (e.first != p) {
      int v = e.first, en = e.second;
      printf("1 %d ", en);
      cur = fmod(cur + delta, 2);
      if (cur <= 1) {
        printf("%d %d %.10f\n", v, u, 1 - cur);
      } else {
        printf("%d %d %.10f\n", u, v, 2 - cur);
      }
      dfs(v, u, fmod(cur + 1, 2));
    }
}
int main() {
  int N;
  scanf("%d", &N);
  printf("%d\n", N - 1);
  for (int i = 1; i < N; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back({v, i});
    g[v].push_back({u, i});
  }
  dfs(1, -1, 0);
}
