#include <bits/stdc++.h>
using namespace std;
long long readi() {
  long long input = 0;
  char c = ' ';
  while (c < '-') {
    c = getchar();
  }
  bool negative = false;
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  while (c >= '0') {
    input = 10 * input + (c - '0');
    c = getchar();
  }
  if (negative) {
    input = -input;
  }
  return input;
}
string reads() {
  string input = "";
  char c = ' ';
  while (c <= ' ') {
    c = getchar();
  }
  while (c > ' ') {
    input += c;
    c = getchar();
  }
  return input;
}
void printi(long long output) {
  if (output == 0) {
    putchar('0');
    return;
  }
  if (output < 0) {
    putchar('-');
    output = -output;
  }
  vector<char> vout;
  while (output) {
    vout.push_back((output % 10) + '0');
    output /= 10;
  }
  for (int i = vout.size() - 1; i >= 0; i--) {
    putchar(vout[i]);
  }
  return;
}
void prints(string output) {
  for (int i = 0; i < output.length(); i++) {
    putchar(output[i]);
  }
  return;
}
int N;
vector<pair<int, int> > edge[505];
int parent[505];
long double dp[505];
void dfs_par(int u) {
  for (int i = 0; i < edge[u].size(); i++) {
    int v = edge[u][i].first;
    if (parent[u] == v) {
      continue;
    }
    parent[v] = u;
    dfs_par(v);
  }
  return;
}
void solve(int u) {
  long double dist = dp[u];
  for (int i = 0; i < edge[u].size(); i++) {
    int v = edge[u][i].first;
    int eid = edge[u][i].second;
    if (v == parent[u]) {
      continue;
    }
    cout << 1 << ' ' << eid << ' ';
    dist += 2.0 / ((long double)edge[u].size());
    if (dist + 0.000000000000001 > 2.0) {
      dist -= 2.0;
    }
    if (dist < 1.0 - 0.000000000000001) {
      cout << u + 1 << ' ' << v + 1 << ' ' << dist << '\n';
      dp[v] = dist + 1.0;
    } else {
      cout << v + 1 << ' ' << u + 1 << ' ' << dist - 1.0 << '\n';
      dp[v] = dist - 1.0;
    }
    solve(v);
  }
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  if (fopen("cf822f.in", "r")) {
    freopen("cf822f.in", "r", stdin);
    freopen("cf822f.out", "w", stdout);
  }
  cin >> N;
  cout << N - 1 << '\n';
  cout << fixed << setprecision(10);
  for (int i = 1; i < N; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    edge[a].push_back(make_pair(b, i));
    edge[b].push_back(make_pair(a, i));
  }
  parent[0] = N;
  dfs_par(0);
  for (int i = 0; i < edge[0].size(); i++) {
    int v = edge[0][i].first;
    int eid = edge[0][i].second;
    long double dist = ((long double)i) * 2.0 / ((long double)edge[0].size());
    cout << 1 << ' ' << eid << ' ';
    if (dist < 1.0 - 0.000000000000001) {
      cout << 1 << ' ' << v + 1 << ' ' << dist << '\n';
      dp[v] = dist + 1.0;
    } else {
      cout << v + 1 << ' ' << 1 << ' ' << dist - 1.0 << '\n';
      dp[v] = dist - 1.0;
    }
  }
  for (int i = 0; i < edge[0].size(); i++) {
    int v = edge[0][i].first;
    solve(v);
  }
  return 0;
}
