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;
char buf[1 << 21], *p1 = buf, *p2 = buf;
template <class T>
void read(T &x) {
  x = 0;
  int c = getchar();
  int flag = 0;
  while (c < '0' || c > '9') flag |= (c == '-'), c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  if (flag) x = -x;
}
template <class T>
T _max(T a, T b) {
  return b < a ? a : b;
}
template <class T>
T _min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
bool checkmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
bool checkmin(T &a, T b) {
  return b < a ? a = b, 1 : 0;
}
const int N = 82;
int n;
int l[N], r[N], foo[N];
int arr[N << 1], top = 0;
int L, R;
double f[N][N], g[N][N];
double ans[N][N];
void init() {
  read(n);
  for (int i = 1; i <= n; ++i) {
    read(l[i]);
    read(r[i]);
    arr[++top] = l[i];
    arr[++top] = r[i];
    foo[i] = r[i] - l[i];
  }
  sort(arr + 1, arr + top + 1);
  top = unique(arr + 1, arr + top + 1) - arr - 1;
}
double calcl(int idx) {
  return 1.0 * _min(_max(0, L - l[idx]), foo[idx]) / foo[idx];
}
double calcr(int idx) {
  return 1.0 * _min(_max(0, r[idx] - R), foo[idx]) / foo[idx];
}
double calcmid(int idx) { return 1 - calcl(idx) - calcr(idx); }
void run(int idx, int bar) {
  L = arr[bar], R = arr[bar + 1];
  if (L < l[idx] || R > r[idx]) return;
  memset(f, 0, sizeof f);
  f[0][0] = 1;
  int tot = 0;
  for (int i = 1; i <= n; ++i) {
    if (i == idx) continue;
    ++tot;
    double cl = calcl(i), cr = calcr(i), cm = calcmid(i);
    for (int j = tot; j >= 0; --j) {
      for (int k = tot - j; k >= 0; --k) {
        if (j + k < tot)
          f[j][k] *= cm;
        else
          f[j][k] = 0;
        if (j) f[j][k] += f[j - 1][k] * cl;
        if (k) f[j][k] += f[j][k - 1] * cr;
      }
    }
  }
  double co = 1.0 * (R - L) / foo[idx];
  for (int i = 0; i <= tot; ++i) {
    for (int j = 0; i + j <= tot; ++j) {
      int num = tot - i - j + 1;
      double res = f[i][j] / num * co;
      ans[idx][i + 1] += res;
      ans[idx][n - j + 1] -= res;
    }
  }
}
void solve() {
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j < top; ++j) {
      run(i, j);
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      ans[i][j] += ans[i][j - 1];
      printf("%.8lf%c", ans[i][j], " \n"[j == n]);
    }
  }
}
int main() {
  init();
  solve();
  return 0;
}