#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
vector<pair<int, int> > mp[225];
struct mb {
  int id, u, v;
  long double x;
  void pp() {
    printf("1 %d ", id);
    if (x > 1) {
      swap(u, v);
      x -= 1;
    }
    printf("%d %d %.10Lf\n", u, v, x);
  }
};
vector<mb> ans;
void add(long double &t, long double x) {
  t += x;
  if (t >= 2) t -= 2;
}
void dfs(int x, int pa, long double dis) {
  long double me = dis > 1 ? 3 - dis : 1 - dis;
  long double step = 2.0 / mp[x].size();
  long double t = step - me;
  while (t < 0) t += 2;
  for (auto c : mp[x])
    if (c.first != pa) {
      ans.push_back({c.second, x, c.first, t});
      dfs(c.first, x, t);
      add(t, step);
    }
}
void fmain(int tid) {
  scanf("%d", &n);
  for (int i = 1, u, v; i <= n - 1; i++) {
    scanf("%d%d", &u, &v);
    mp[u].push_back({v, i});
    mp[v].push_back({u, i});
  }
  long double dis = 2.0 / mp[1].size();
  long double t = 0;
  for (auto c : mp[1]) {
    ans.push_back({c.second, 1, c.first, t});
    dfs(c.first, 1, t);
    add(t, dis);
  }
  printf("%d\n", n - 1);
  for (mb g : ans) g.pp();
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
