#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
struct edge {
  int v, id, nex;
  edge(int v = 0, int id = 0, int nex = 0) : v(v), id(id), nex(nex) {}
} e[maxn << 1];
int head[maxn], deg[maxn], en, n;
void add(int u, int v, int id) { e[++en] = edge(v, id, head[u]), head[u] = en; }
void dfs(int u, int fa, int id, double x) {
  if (fa) {
    if (x <= 1)
      printf("1 %d %d %d %.8f\n", id, fa, u, 1 - x);
    else
      printf("1 %d %d %d %.8f\n", id, u, fa, 2 - x);
  }
  for (int i = head[u]; i; i = e[i].nex)
    if (e[i].v != fa) {
      x += 2.0 / deg[u];
      if (x >= 2) x -= 2;
      if (x <= 1)
        dfs(e[i].v, u, e[i].id, x + 1);
      else
        dfs(e[i].v, u, e[i].id, x - 1);
    }
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n - 1); ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    ++deg[u], ++deg[v];
    add(u, v, i);
    add(v, u, i);
  }
  printf("%d\n", n - 1);
  dfs(1, 0, 0, 0);
  return 0;
}
