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;
inline int rd() {
  int x = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return x * f;
}
const int MAXN = 300;
const double eps = 1e-9;
int N, l[MAXN], r[MAXN];
double f[2][MAXN][MAXN];
int ls[MAXN], to[MAXN];
double ans[MAXN][MAXN];
int main() {
  N = rd();
  for (register int i = 1; i <= N; ++i)
    l[i] = rd(), r[i] = rd(), ls[++*ls] = l[i], ls[++*ls] = r[i];
  sort(ls + 1, ls + *ls + 1);
  *ls = unique(ls + 1, ls + *ls + 1) - ls - 1;
  for (register int i = 1; i <= N; ++i)
    l[i] = lower_bound(ls + 1, ls + *ls + 1, l[i]) - ls,
    r[i] = lower_bound(ls + 1, ls + *ls + 1, r[i]) - ls;
  register int x, y, xx, i, j;
  for (i = 1; i <= N; ++i) {
    for (xx = l[i]; xx < r[i]; ++xx) {
      double chance_seg = (double)(ls[xx + 1] - ls[xx]) / (ls[r[i]] - ls[l[i]]);
      for (x = 0; x <= N; ++x)
        for (y = 0; y <= N; ++y) f[0][x][y] = f[1][x][y] = 0;
      int now = 1;
      f[now][0][0] = 1.0;
      for (j = 1; j <= N; ++j)
        if (i != j) {
          now ^= 1;
          if (xx < l[j]) {
            for (x = 0; x <= j; ++x)
              for (y = 0; y <= j - x; ++y)
                if (f[!now][x][y] > eps) {
                  f[now][x][y] += f[!now][x][y];
                  f[!now][x][y] = 0;
                }
          } else if (r[j] <= xx) {
            for (x = 0; x <= j; ++x)
              for (y = 0; y <= j - x; ++y)
                if (f[!now][x][y] > eps) {
                  f[now][x + 1][y] += f[!now][x][y];
                  f[!now][x][y] = 0;
                }
          } else {
            double L = ls[l[j]], R = ls[r[j]];
            double chance_less = (double)(ls[xx] - L) / (R - L),
                   chance_equal = (double)(ls[xx + 1] - ls[xx]) / (R - L),
                   chance_greater = (double)(R - ls[xx + 1]) / (R - L);
            for (x = 0; x <= j; ++x)
              for (y = 0; y <= j - x; ++y)
                if (f[!now][x][y] > eps) {
                  f[now][x + 1][y] += 1.0 * f[!now][x][y] * chance_less;
                  f[now][x][y + 1] += 1.0 * f[!now][x][y] * chance_equal;
                  f[now][x][y] += 1.0 * f[!now][x][y] * chance_greater;
                  f[!now][x][y] = 0;
                }
          }
        }
      for (int x = 0; x <= N; ++x)
        for (int y = 0; y <= N - x; ++y)
          if (f[now][x][y] > eps) {
            double rank_chance = 1.0 / (y + 1.0);
            for (int l = 0; l <= y; ++l) {
              ans[i][x + 1 + l] += chance_seg * rank_chance * f[now][x][y];
            }
          }
    }
  }
  for (register int i = 1; i <= N; ++i, printf("\n")) {
    for (register int j = 1; j <= N; ++j) printf("%.10lf ", ans[i][j]);
  }
  return 0;
}