#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, eu[N], ev[N];
vector<int> adj[N];
vector<pair<int, pair<int, pair<int, double>>>> ans;
void print(int u, int v, int e, double s) {
  if (s <= 1.0) {
    ans.push_back({u, {v, {e, s}}});
  } else {
    ans.push_back({v, {u, {e, s - 1.0}}});
  }
}
void dfs(int u, int p = -1, double off = 0.0) {
  int deg = adj[u].size();
  double part = 2.0 / max(1, deg);
  for (int e : adj[u]) {
    int v = eu[e] == u ? ev[e] : eu[e];
    if (v != p) {
      off += part;
      while (off >= 2.0) off -= 2.0;
      print(v, u, e, off);
      dfs(v, u, off + 1.0);
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(i);
    adj[v].push_back(i);
    eu[i] = u;
    ev[i] = v;
  }
  dfs(1);
  printf("%d\n", (int)ans.size());
  for (auto& it : ans) {
    int u = it.first;
    int v = it.second.first;
    int e = it.second.second.first;
    double s = it.second.second.second;
    printf("1 %d %d %d %.10lf\n", e, u, v, s);
  }
}
