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 char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(long long a) {
  write(a);
  puts("");
}
inline void wri(long long a) {
  write(a);
  putchar(' ');
}
inline unsigned long long rnd() {
  return ((unsigned long long)rand() << 30 ^ rand()) << 4 | rand() % 4;
}
const int N = 85;
int n, tot, L[N], r[N], q[N << 1];
double dp[N][N], ans[N][N], sum[N], len[N];
signed main() {
  n = read();
  for (int i = 1; i <= n; i++) {
    L[i] = read();
    r[i] = read();
    q[++tot] = L[i];
    q[++tot] = r[i];
  }
  sort(&q[1], &q[tot + 1]);
  tot = unique(&q[1], &q[tot + 1]) - q - 1;
  for (int i = 1; i <= n; i++) {
    len[i] = r[i] - L[i];
    L[i] = lower_bound(&q[1], &q[tot + 1], L[i]) - q;
    r[i] = lower_bound(&q[1], &q[tot + 1], r[i]) - q;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = L[i]; j < r[i]; j++) {
      memset(dp, 0, sizeof(dp));
      dp[0][0] = 1;
      for (int k = 1; k <= n; k++)
        if (i != k) {
          double t1 = (L[k] <= j && r[k] > j) ? (q[j + 1] - q[j]) / len[k] : 0,
                 t2 = (L[k] < j) ? (min(q[j] - q[L[k]], (int)len[k]) / len[k])
                                 : 0,
                 t3 = (r[k] > j) ? min(q[r[k]] - q[j + 1], (int)len[k]) / len[k]
                                 : 0;
          if (L[k] > j) continue;
          for (register int l = k; l >= 0; l--) {
            for (register int o = k - l; o >= 0; o--)
              if (dp[l][o] > 0) {
                dp[l + 1][o] += dp[l][o] * t1;
                dp[l][o + 1] += dp[l][o] * t2;
                dp[l][o] = dp[l][o] * t3;
              }
          }
        }
      for (int l = 0; l <= n; l++) sum[l] = 0;
      for (int l = 0; l <= n; l++) {
        for (int o = 0; l + o <= n; o++)
          if (dp[l][o] > 0) {
            sum[o + 1] += dp[l][o] / (l + 1);
            sum[o + l + 2] -= dp[l][o] / (l + 1);
          }
      }
      for (int l = 1; l <= n; l++) {
        sum[l] += sum[l - 1];
        ans[i][l] += sum[l] * (q[j + 1] - q[j]) / len[i];
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) printf("%.6lf ", (double)ans[i][j]);
    puts("");
  }
}