#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433832795;
const long double eps = 1e-10;
const long long prime = 239;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const int BIG = 1e9 + 239;
const int MAX_N = 101;
const int MAX_T = (1 << 18);
const int MAX_LOG = 19;
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {-1, 0, 1, 0};
int n;
vector<pair<int, int> > r;
vector<vector<pair<int, int> > > v(MAX_N);
vector<vector<bool> > f(MAX_N);
long double pos[MAX_N];
void dfs(int p, int pr) {
  if (pr == -1) {
    int kol = v[p].size();
    long double r = 2.0 / (long double)(kol);
    long double ang = 0;
    int it = 0;
    for (pair<int, int> t : v[p]) {
      if (f[p][it])
        pos[t.second] = ang;
      else {
        long double nw = ang + 1;
        if (nw >= 2) nw -= 2;
        pos[t.second] = nw;
      }
      ang += r;
      if (ang >= 2) ang -= 2;
      it++;
    }
  } else {
    int z = 0;
    for (int i = 0; i < v[p].size(); i++)
      if (v[p][i].first == pr) z = i;
    int kol = v[p].size();
    long double r = 2.0 / (long double)(kol);
    long double ang = pos[v[p][z].second];
    if (!f[p][z]) {
      ang = ang + 1;
      if (ang >= 2) ang -= 2;
    }
    int it = z;
    vector<pair<int, int> > now;
    for (int j = z; j < z + kol; j++) now.push_back(v[p][j % kol]);
    for (pair<int, int> t : now) {
      if (f[p][it])
        pos[t.second] = ang;
      else {
        long double nw = ang + 1;
        if (nw >= 2) nw -= 2;
        pos[t.second] = nw;
      }
      ang += r;
      if (ang >= 2) ang -= 2;
      it = (it + 1) % kol;
    }
  }
  for (pair<int, int> t : v[p])
    if (t.first != pr) dfs(t.first, p);
}
int main() {
  cin.sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    v[a].push_back(make_pair(b, i));
    v[b].push_back(make_pair(a, i));
    r.push_back(make_pair(a, b));
    f[a].push_back(true);
    f[b].push_back(false);
  }
  for (int i = 0; i < n - 1; i++) pos[i] = -1;
  dfs(0, -1);
  cout << fixed << setprecision(20);
  cout << n - 1 << "\n";
  for (int i = 0; i < n - 1; i++) {
    cout << "1 " << i + 1 << " ";
    if (pos[i] >= 1) {
      swap(r[i].first, r[i].second);
      pos[i] -= 1;
    }
    cout << r[i].first + 1 << " " << r[i].second + 1 << " " << pos[i] << "\n";
  }
  return 0;
}
