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;
long long rdtsc() {
  long long tmp;
  asm("rdtsc" : "=A"(tmp));
  return tmp;
}
inline int myrand() { return abs((rand() << 15) ^ rand()); }
inline int rnd(int x) { return myrand() % x; }
const int maxn = 80 + 5;
int borders[maxn][2];
int xs[maxn * 2], m;
double d[maxn + 1][maxn + 1], nd[maxn + 1][maxn + 1];
double countProb(int man, int l, int r) {
  l = max(l, borders[man][0]), r = min(r, borders[man][1]);
  if (l >= r) return 0;
  return (double)(xs[r] - xs[l]) / (xs[borders[man][1]] - xs[borders[man][0]]);
}
double res[maxn][maxn + 1];
void addAns(int man, double p, int l, int r) {
  assert(r > l);
  p /= (r - l);
  res[man][l] += p, res[man][r] -= p;
}
int cnt;
void countD(int pos, int l, int r, int taken) {
  if (l + 1 == r) {
    assert(taken == cnt - 1);
    int man = l;
    double p2 = countProb(man, pos, pos + 1);
    for (int x1 = 0; x1 < cnt; ++x1)
      for (int x2 = 0; x1 + x2 < cnt; ++x2)
        addAns(man, d[x1][x2] * p2, x1, x1 + x2 + 1);
    return;
  }
  double prevd[maxn + 1][maxn + 1];
  memcpy(prevd, d, sizeof(d));
  int taken0 = taken;
  int mid = (l + r) / 2;
  int ls[2] = {l, mid}, rs[2] = {mid, r};
  for (int iter = 0; iter < 2; iter++) {
    for (int man = ls[iter]; man < rs[iter]; man++, taken++) {
      double p1 = countProb(man, 0, pos);
      double p2 = countProb(man, pos, pos + 1);
      double p3 = countProb(man, pos + 1, m - 1);
      for (int x1 = 0; x1 <= taken; ++x1) {
        for (int x2 = 0; x2 + x1 <= taken; ++x2) {
          double tmp = d[x1][x2];
          nd[x1 + 1][x2] += tmp * p1;
          nd[x1][x2 + 1] += tmp * p2;
          nd[x1][x2] += tmp * p3;
        }
      }
      for (int x1 = 0; x1 <= taken + 1; ++x1)
        for (int x2 = 0; x1 + x2 <= taken + 1; ++x2)
          d[x1][x2] = nd[x1][x2], nd[x1][x2] = 0;
    }
    countD(pos, ls[!iter], rs[!iter], taken);
    memcpy(d, prevd, sizeof(d));
    taken = taken0;
  }
}
bool solve() {
  if (scanf("%d", &cnt) < 1) return 0;
  m = 0;
  for (int i = 0; i < cnt; ++i)
    for (int j = 0; j < 2; ++j) {
      scanf("%d", &borders[i][j]);
      xs[m++] = borders[i][j];
    }
  sort(xs, xs + m);
  m = unique(xs, xs + m) - xs;
  for (int i = 0; i < cnt; ++i)
    for (int j = 0; j < 2; ++j)
      borders[i][j] = lower_bound(xs, xs + m, borders[i][j]) - xs;
  for (int man = 0; man < cnt; ++man)
    for (int place = 0; place < cnt; ++place) res[man][place] = 0;
  for (int pos = 0; pos < m - 1; ++pos) {
    memset(d, 0, sizeof(d));
    memset(nd, 0, sizeof(nd));
    d[0][0] = 1;
    countD(pos, 0, cnt, 0);
  }
  for (int man = 0; man < cnt; ++man) {
    for (int place = 0; place < cnt; ++place)
      res[man][place + 1] += res[man][place];
  }
  for (int man = 0; man < cnt; ++man) {
    for (int place = 0; place < cnt; ++place)
      printf("%.9lf%c", (double)res[man][place], " \n"[place == cnt - 1]);
  }
  return 1;
}
int main() {
  srand(rdtsc());
  while (1) {
    if (!solve()) break;
  }
  return 0;
}