Problem: Imagine a real contest or exam of n participants. Every participant will get a particular score. We can predict the standings board more or less, if we do some statistics on their previous performance.

<image>

Let's say the score of the participants will be uniformly distributed in interval [li, ri] (the score can be a real number). Can you predict the standings board according to these data? In other words you should say for each participant the probability that he gets some fixed place in the scoreboard. The participants are sorted by increasing of their scores in the scoreboard. So, the participant with the largest score gets the last place.

Input

The first line contains integer n (1 ≤ n ≤ 80), showing how many participants we have. Each of the next n lines contains our predictions, the i-th line contains a pair of integers li, ri (0 ≤ li < ri ≤ 109) as the distributed interval for participant i.

Consider the participants numbered from 1 to n in some way.

Output

Output a distributed matrix a of order n. The element aij of the matrix is the probability that participant i has rank j.

Your answer will considered correct if it has at most 10 - 6 absolute or relative error.

Examples

Input

2
1 6
4 9


Output

0.9200000000 0.080 
0.080 0.9200000000 


Input

8
0 2
1 3
2 4
3 5
4 6
5 7
6 8
7 9


Output

0.875 0.125 0 0 0 0 0 0 
0.125 0.750 0.125 0 0 0 0 0 
0 0.125 0.750 0.125 0 0 0 0 
0 0 0.125 0.750 0.125 0 0 0 
0 0 0 0.125 0.750 0.125 0 0 
0 0 0 0 0.125 0.750 0.125 0 
0 0 0 0 0 0.125 0.750 0.125 
0 0 0 0 0 0 0.125 0.875 

Note

The score probability distribution is continuous, which means, there is no possibility for a draw.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
void Get(int &T) {
  char C;
  bool F = 0;
  for (; C = getchar(), C < '0' || C > '9';)
    if (C == '-') F = 1;
  for (T = C - '0'; C = getchar(), C >= '0' && C <= '9'; T = T * 10 + C - '0')
    ;
  F && (T = -T);
}
int N;
int L[10005];
int R[10005];
double Len[10005];
int Pos[10005];
int Top;
void Init() {
  Get(N);
  for (int k = 1; k <= N; k++) {
    Get(L[k]);
    Get(R[k]);
    Pos[++Top] = L[k];
    Pos[++Top] = R[k];
    Len[k] = R[k] - L[k];
  }
  std::sort(Pos + 1, Pos + Top + 1);
}
int Q[10005];
int QTop;
double LenNow;
void Mul(int p, double Mid, double Le, long double F[][85], int &Sz) {
  long double k;
  for (int i = Sz; i >= 0; i--)
    for (int j = Sz; j >= 0; j--) {
      if (F[i][j] == 0) continue;
      k = F[i][j] / Len[p];
      F[i + 1][j + 1] += k * LenNow;
      F[i + 1][j] += k * (Le - L[p]);
      F[i][j] = k * (R[p] - Le);
      F[i][j + 1] -= k * LenNow;
    }
  Sz++;
}
long double F[85][85][85];
int Delta;
int Size[85];
long double G[85][85];
void Bin(int X, int Left, int Right, double Middle, double Le) {
  if (Left == Right) {
    for (int i = 0; i <= Size[X]; i++)
      for (int j = 0; j <= Size[X]; j++) {
        if (F[X][i][j] == 0) continue;
        F[X][i][j] /= ((j + 1));
        G[Q[Left]][i + 1 + Delta] += F[X][i][j];
      }
    return;
  }
  int Mid = Left + Right;
  Mid >>= 1;
  memcpy(F[X + 1], F[X], sizeof F[0]);
  Size[X + 1] = Size[X];
  for (int k = Mid + 1; k <= Right; k++)
    Mul(Q[k], Middle, Le, F[X + 1], Size[X + 1]);
  Bin(X + 1, Left, Mid, Middle, Le);
  memcpy(F[X + 1], F[X], sizeof F[0]);
  Size[X + 1] = Size[X];
  for (int k = Left; k <= Mid; k++)
    Mul(Q[k], Middle, Le, F[X + 1], Size[X + 1]);
  Bin(X + 1, Mid + 1, Right, Middle, Le);
}
void Calc(double Le, double Ri) {
  double Middle = Le + Ri;
  Middle *= 0.5;
  LenNow = Ri - Le;
  Delta = QTop = 0;
  for (int k = 1; k <= N; k++) {
    if (L[k] < Middle && Middle < R[k]) Q[++QTop] = k;
    if (Middle > R[k]) Delta++;
  }
  memset(F[1], 0, sizeof F[0]);
  F[1][0][0] = LenNow;
  if (QTop > 0) Bin(1, 1, QTop, Middle, Le);
}
void Work() {
  for (int k = 2; k <= Top; k++)
    if (Pos[k - 1] != Pos[k]) Calc(Pos[k - 1], Pos[k]);
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= N; j++) G[i][j] /= Len[i];
}
void Output() {
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) printf("%.15lf ", (double)G[i][j]);
    puts("");
  }
}
int main() {
  Init();
  Work();
  Output();
  return 0;
}