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;
template <class T>
inline T min(T &a, T &b) {
  return a < b ? a : b;
}
template <class T>
inline T max(T &a, T &b) {
  return a > b ? a : b;
}
template <class T>
void read(T &x) {
  char ch;
  while ((ch = getchar()) && !(ch >= '0' && ch <= '9'))
    ;
  x = ch - '0';
  while ((ch = getchar()) && (ch >= '0' && ch <= '9')) x = x * 10 + ch - '0';
}
struct point {
  int x, y;
  point() {}
  point(int _x, int _y) : x(_x), y(_y) {}
};
long long Pow(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long Pow(long long a, long long b) {
  long long res = 1;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a;
    a = a * a;
  }
  return res;
}
const int N = 90;
struct lj {
  int l, r, lc, rc;
} P[N];
inline int cmp(const lj &a, const lj &b) {
  return a.l < b.l || (a.l == b.l && a.r < b.r);
}
const double eps = 1e-12;
int n, Hash[N << 1], hl;
double f[N][N], ans[N][N];
void print() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) printf("%.10lf ", ans[i][j]);
    puts("");
  }
}
void work(int cur) {
  for (int i = 0; i <= n; i++) ans[cur][i] = 0;
  for (int i = P[cur].lc; i <= P[cur].rc; i++) {
    int maxl = 0, maxll = 0;
    for (int l = 0; l <= n; l++)
      for (int ll = 0; ll <= n; ll++) f[l][ll] = 0;
    f[0][0] = 1;
    for (int j = 1; j <= n; j++)
      if (j != cur)
        if (i >= P[j].lc && i <= P[j].rc) {
          double a = (double)(Hash[i + 1] - Hash[i]) /
                     (double)(P[j].r - P[j].l),
                 b = (double)(Hash[i] - Hash[P[j].lc]) /
                     (double)(P[j].r - P[j].l),
                 c = (double)(Hash[P[j].rc + 1] - Hash[i + 1]) /
                     (double)(P[j].r - P[j].l);
          for (int l = maxl; l >= 0; l--)
            for (int ll = maxll; ll >= 0; ll--)
              if (f[l][ll] > eps) {
                f[l + 1][ll] += f[l][ll] * a;
                f[l][ll + 1] += f[l][ll] * b;
                f[l][ll] = f[l][ll] * c;
              }
          maxll++, maxl++;
        } else if (P[j].rc < i) {
          for (int l = maxl; l >= 0; l--)
            for (int ll = maxll; ll >= 0; ll--)
              if (f[l][ll] > eps) f[l][ll + 1] += f[l][ll], f[l][ll] = 0;
          maxll++;
        }
    for (int l = 0; l <= maxl; l++)
      for (int ll = 0; ll <= maxll; ll++) {
        double c = f[l][ll] * 1. / (l + 1) * (double)(Hash[i + 1] - Hash[i]) /
                   (double)(P[cur].r - P[cur].l);
        ans[cur][ll + 1] += c;
        ans[cur][ll + l + 2] -= c;
      }
  }
  for (int i = 1; i <= n; i++) ans[cur][i] += ans[cur][i - 1];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &P[i].l, &P[i].r);
  for (int i = 1; i <= n; i++) Hash[++hl] = P[i].l, Hash[++hl] = P[i].r;
  sort(Hash + 1, Hash + hl + 1);
  hl = unique(Hash + 1, Hash + hl + 1) - Hash - 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= hl; j++)
      if (P[i].l == Hash[j]) {
        P[i].lc = j;
        break;
      }
    for (int j = 1; j <= hl; j++)
      if (P[i].r == Hash[j]) {
        P[i].rc = j - 1;
        break;
      }
  }
  for (int _ = 1; _ <= n; _++) work(_);
  print();
}