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;
const int inf = ~0U >> 1;
const long long INF = ~0ULL >> 1;
template <class T>
inline void read(T &n) {
  char c;
  for (c = getchar(); !(c >= '0' && c <= '9'); c = getchar())
    ;
  n = c - '0';
  for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) n = n * 10 + c - '0';
}
int Pow(int base, int n, int mo) {
  if (n == 0) return 1;
  if (n == 1) return base % mo;
  int tmp = Pow(base, n >> 1, mo);
  tmp = (long long)tmp * tmp % mo;
  if (n & 1) tmp = (long long)tmp * base % mo;
  return tmp;
}
double dp[90][90], ans[90][90];
int h[200], L[200], R[200], n, N;
int main() {
  scanf("%d", &N);
  for (int i = (1); i <= (N); ++i) {
    scanf("%d%d", &L[i], &R[i]);
    h[++n] = L[i];
    h[++n] = R[i];
  }
  sort(h + 1, h + n + 1);
  n = unique(h + 1, h + n + 1) - h - 1;
  for (int stu = (1); stu <= (N); ++stu) {
    for (int k = (1); k <= (n - 1); ++k) {
      if (!(h[k] >= L[stu] && h[k + 1] <= R[stu])) continue;
      memset(dp, 0, sizeof(dp));
      dp[0][0] = 1;
      int cnt_pre = 0, cnt_back = 0;
      for (int i = (0); i <= (N - 1); ++i) {
        if (i + 1 == stu) continue;
        if (R[i + 1] <= h[k])
          cnt_pre++;
        else if (L[i + 1] >= h[k + 1])
          cnt_back++;
        else {
          double p1 = (double)(h[k] - L[i + 1]) / (R[i + 1] - L[i + 1]);
          double p2 = (double)(h[k + 1] - h[k]) / (R[i + 1] - L[i + 1]);
          double p3 = (double)(R[i + 1] - h[k + 1]) / (R[i + 1] - L[i + 1]);
          for (int pre = (i - cnt_pre - cnt_back); pre >= (0); --pre)
            for (int in = (i - cnt_pre - cnt_back - pre); in >= (0); --in) {
              dp[pre + 1][in] += dp[pre][in] * p1;
              dp[pre][in + 1] += dp[pre][in] * p2;
              dp[pre][in] *= p3;
            }
        }
      }
      for (int pre = (cnt_pre); pre <= (N); ++pre)
        for (int in = (1); in <= (N); ++in)
          if (dp[pre - cnt_pre][in - 1])
            for (int rank = (pre + 1); rank <= (pre + in); ++rank)
              ans[stu][rank] += dp[pre - cnt_pre][in - 1] / in *
                                (h[k + 1] - h[k]) / (R[stu] - L[stu]);
    }
  }
  for (int i = (1); i <= (N); ++i) {
    for (int j = (1); j <= (N); ++j) printf("%.10lf ", ans[i][j]);
    puts("");
  }
  cerr << clock() << endl;
  return 0;
}