#include <bits/stdc++.h>
using namespace std;
vector<int> adjList[101];
map<pair<int, int>, int> mapping;
void bfs() {
  vector<int> visited(101, 0);
  deque<pair<int, double> > q;
  visited[1] = 1;
  q.push_back(make_pair(1, 0.0));
  while (!q.empty()) {
    int node = q.front().first;
    double dist = (double)q.front().second;
    q.pop_front();
    double k = 2.0 / (double)adjList[node].size();
    double x = 1.0;
    for (int i = 0; i < adjList[node].size(); i++) {
      int dest = adjList[node][i];
      if (visited[dest] == 1) continue;
      visited[dest] = 1;
      double d = fmod(dist + x * k, 2.0);
      if (d > 1.0) {
        cout << 1 << " " << mapping[make_pair(node, dest)] << " " << dest << " "
             << node << " " << d - 1.0 << endl;
        q.push_back(make_pair(dest, d - 1.0));
      } else {
        cout << 1 << " " << mapping[make_pair(node, dest)] << " " << node << " "
             << dest << " " << d << endl;
        q.push_back(make_pair(dest, 1.0 + d));
      }
      x++;
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    adjList[a].push_back(b);
    adjList[b].push_back(a);
    mapping[make_pair(a, b)] = i + 1;
    mapping[make_pair(b, a)] = i + 1;
  }
  cout << n - 1 << endl;
  bfs();
}
