#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 77;
int n, From[N], To[N];
long double A[N];
vector<int> a[N];
void dfs(int v, int prev) {
  long double t = 2.0 / ((int)a[v].size()), st = 1.0 + A[prev];
  for (int x : a[v]) {
    if (x == prev) {
      continue;
    }
    if (From[x] != v) {
      swap(From[x], To[x]);
    }
    int u = To[x];
    st = st + t;
    while (st > 2.0) {
      st -= 2.0;
    }
    A[x] = st;
    dfs(u, x);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &From[i], &To[i]);
    a[From[i]].push_back(i);
    a[To[i]].push_back(i);
  }
  dfs(1, n);
  printf("%d\n", n - 1);
  for (int i = 1; i < n; i++) {
    if (A[i] > 1) {
      swap(From[i], To[i]);
      A[i] -= 1;
    }
    printf("%d %d %d %d %.13lf\n", 1, i, From[i], To[i], (double)A[i]);
  }
  return 0;
}
