#include <bits/stdc++.h>
using namespace std;
struct node {
  int y, k, next;
} a[210];
int first[110], len;
int d[110], K[110], F[110];
double ans[110];
void ins(int x, int y, int k) {
  a[++len].y = y;
  a[len].k = k;
  a[len].next = first[x];
  first[x] = len;
}
void dfs(int x, int fa) {
  int k, y;
  double p, h;
  F[x] = fa;
  if (!fa) {
    p = 2.0 / d[x];
    h = 0;
  } else {
    p = 2.0 / d[x];
    if (ans[x] < 1)
      h = ans[x] + 1;
    else
      h = ans[x] - 1;
  }
  for (k = first[x]; k; k = a[k].next) {
    y = a[k].y;
    if (y == fa) continue;
    K[y] = a[k].k;
    h += p;
    if (h >= 2) h -= 2;
    ans[y] = h;
    dfs(y, x);
  }
}
int main() {
  int n, i, j, x, y;
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    ins(x, y, i);
    ins(y, x, i);
    d[x]++;
    d[y]++;
  }
  dfs(1, 0);
  printf("%d\n", n - 1);
  for (i = 2; i <= n; i++) {
    printf("%d %d ", 1, K[i]);
    if (ans[i] < 1)
      printf("%d %d %.8lf\n", F[i], i, ans[i]);
    else
      printf("%d %d %.8lf\n", i, F[i], ans[i] - 1);
  }
  return 0;
}
