#include <bits/stdc++.h>
using namespace std;
void _dbg(string) { cout << endl; }
template <class H, class... T>
void _dbg(string s, H h, T... t) {
  int l = s.find(',');
  cout << s.substr(0, l) << " = " << h << ", ";
  _dbg(s.substr(l + 1), t...);
}
template <class T, class U>
ostream& operator<<(ostream& o, const pair<T, U>& p) {
  o << "(" << p.first << "," << p.second << ")";
  return o;
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "[";
  for (T t : v) {
    o << t << ",";
  }
  o << "]";
  return o;
}
vector<pair<int, int>> tree[105];
int u[105], v[105];
int x[105];
int vtime[105];
void dfs(int d, int from) {
  long long span = 2 * 1000000000 / tree[d].size();
  long long crnt = vtime[d];
  for (auto to : tree[d])
    if (to.first != from) {
      crnt = (crnt + span) % (2 * 1000000000);
      int id = to.second;
      if (crnt <= 1000000000) {
        u[id] = to.first;
        v[id] = d;
        x[id] = 1000000000 - crnt;
        vtime[to.first] = crnt + 1000000000;
      } else {
        u[id] = d;
        v[id] = to.first;
        x[id] = 2 * 1000000000 - crnt;
        vtime[to.first] = crnt - 1000000000;
      }
      dfs(to.first, d);
    }
}
int main() {
  int n;
  cin >> n;
  for (int i = (int)(0); i < (int)(n - 1); i++) {
    cin >> u[i] >> v[i];
    u[i]--;
    v[i]--;
    tree[u[i]].push_back((make_pair((v[i]), (i))));
    tree[v[i]].push_back((make_pair((u[i]), (i))));
  }
  fill(vtime, vtime + n, -1);
  x[0] = 1000000000 / 2;
  vtime[v[0]] = 1000000000 / 2;
  vtime[u[0]] = 1000000000 + 1000000000 / 2;
  dfs(v[0], u[0]);
  dfs(u[0], v[0]);
  cout << n - 1 << endl;
  for (int i = (int)(0); i < (int)(n - 1); i++) {
    if (x[i] == 1000000000)
      printf("1 %d %d %d 1.000000000\n", i + 1, u[i] + 1, v[i] + 1);
    else
      printf("1 %d %d %d 0.%09d\n", i + 1, u[i] + 1, v[i] + 1, x[i]);
  }
  return 0;
}
