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 MAX = 80 + 10;
int n;
pair<int, int> val[MAX];
vector<int> place;
int L, R;
long double to[MAX][MAX][MAX], tmp[MAX];
void mult(long double* ans, long double* p, long double a, long double b) {
  int i;
  for ((i) = (0); (i) <= (n); ++(i)) ans[i] = 0;
  for ((i) = (0); (i) <= (n); ++(i)) {
    ans[i] += p[i] * b;
    ans[i + 1] += p[i] * a;
  }
}
void add(long double* ans, long double* a, long double* b) {
  int i;
  for ((i) = (0); (i) <= (n); ++(i)) ans[i] = a[i] + b[i];
}
void copy(long double* a, long double* b) {
  int i;
  for ((i) = (0); (i) <= (n); ++(i)) a[i] = b[i];
}
int top, num, shift;
long double tt[MAX][MAX][MAX];
long double f[MAX][MAX];
void get(int l, int r, long double X) {
  int i;
  if (r <= L)
    ++shift;
  else if (R <= l)
    ;
  else {
    ++num;
    long double len = r - l;
    long double win_a = X / len;
    long double win_b = -l / len;
    long double loss_b = r / len;
    for (i = num; i >= 1; --i) {
      for (int j = num; j >= 0; --j) {
        long double ans = 0;
        ans += f[i][j] * loss_b;
        ans += f[i - 1][j] * win_b;
        if (j) {
          ans += f[i][j - 1] * -win_a;
          ans += f[i - 1][j - 1] * win_a;
        }
        f[i][j] = ans;
      }
    }
    mult(tmp, f[0], -win_a, loss_b);
    copy(f[0], tmp);
  }
}
void work(int l, int r, long double X, int flag) {
  if (l == r) {
    if (L >= val[l].second || R <= val[l].first) return;
    int i, j;
    for ((i) = (0); (i) <= (n - 1); ++(i)) {
      for ((j) = (0); (j) <= (n); ++(j))
        if (i + shift <= n) to[l][i + shift][j] += flag * f[i][j];
    }
    return;
  }
  int mid = (l + r) / 2;
  int i;
  ++top;
  int tmp_shift = shift;
  int tmp_num = num;
  for ((i) = (0); (i) <= (n - 1); ++(i)) copy(tt[top][i], f[i]);
  for ((i) = (mid + 1); (i) <= (r); ++(i)) get(val[i].first, val[i].second, X);
  work(l, mid, X, flag);
  num = tmp_num;
  shift = tmp_shift;
  for ((i) = (0); (i) <= (n - 1); ++(i)) copy(f[i], tt[top][i]);
  for ((i) = (l); (i) <= (mid); ++(i)) get(val[i].first, val[i].second, X);
  work(mid + 1, r, X, flag);
  --top;
  num = tmp_num;
  shift = tmp_shift;
}
int main() {
  int i, j, k;
  scanf("%d", &n);
  for ((i) = (1); (i) <= (n); ++(i)) {
    scanf("%d%d", &val[i].first, &val[i].second);
    place.push_back(val[i].first);
    place.push_back(val[i].second);
  }
  sort(place.begin(), place.end());
  place.resize(unique(place.begin(), place.end()) - place.begin());
  for ((i) = (0); (i) != ((int)place.size() - 1); ++(i)) {
    L = place[i];
    R = place[i + 1];
    int j;
    for ((j) = (1); (j) <= (n); ++(j)) {
      val[j].first -= L;
      val[j].second -= L;
    }
    R -= L;
    L = 0;
    memset(f, 0, sizeof f);
    f[0][0] = R;
    work(1, n, R, 1);
    L = place[i];
    for ((j) = (1); (j) <= (n); ++(j)) {
      val[j].first += L;
      val[j].second += L;
    }
  }
  for ((i) = (1); (i) <= (n); ++(i)) {
    for ((j) = (0); (j) <= (n - 1); ++(j)) {
      long double answer = 0;
      for ((k) = (0); (k) <= (n); ++(k)) answer += to[i][j][k] / (k + 1);
      printf("%.10lf ", (double)answer / (val[i].second - val[i].first));
    }
    printf("\n");
  }
  return 0;
}