#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
const double eps = 1e-8;
int n;
vector<pair<int, int> > G[maxn];
inline void print(int id, int u, int v, double x) {
  if (x + eps >= 1) {
    x -= 1;
    swap(u, v);
  }
  printf("1 %d %d %d %.12f\n", id, u, v, x);
}
void dfs(int u, int fa, double x) {
  for (int i = 0; i < (int)G[u].size(); ++i) {
    int v = G[u][i].first;
    if (v == fa) continue;
    x += 2. / G[u].size();
    if (x + eps >= 2) x -= 2;
    print(G[u][i].second, u, v, x);
    dfs(v, u, x + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(pair<int, int>(v, i));
    G[v].push_back(pair<int, int>(u, i));
  }
  printf("%d\n", n - 1);
  dfs(1, -1, 0);
  return 0;
}
