#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int u, v;
  double d;
  int other(int x) { return u ^ v ^ x; }
  void set(int x, double dd) {
    if (x != u) swap(u, v);
    assert(x == u);
    if (dd < 1)
      d = dd;
    else {
      swap(u, v);
      d = dd - 1;
    }
  }
  double get(int x) {
    if (u == x)
      return d;
    else
      return 1 + d;
  }
};
const int N = 105;
vector<Edge> edges;
vector<int> adj[N];
void dfs(int u, int par) {
  double base = 0;
  if (par != -1) base = edges[par].get(u);
  double inc = 2.0 / adj[u].size();
  for (int e : adj[u]) {
    if (e == par) continue;
    base += inc;
    if (base >= 2) base -= 2;
    edges[e].set(u, base);
    dfs(edges[e].other(u), e);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    edges.push_back({u, v, 0});
    adj[u].push_back(edges.size() - 1);
    adj[v].push_back(edges.size() - 1);
  }
  dfs(1, -1);
  cout << setprecision(10) << fixed;
  cout << n - 1 << endl;
  for (int i = 0; i < edges.size(); i++) {
    cout << 1 << " " << i + 1 << " " << edges[i].u << " " << edges[i].v << " "
         << edges[i].d << endl;
  }
}
