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;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
int n, m;
double res[100][100][100];
double ans[100][100];
int who[100];
int shift;
pair<int, int> range[100];
int zip[200], zn;
double lp[100], cp[100], rp[100];
void calc(int l, int r, double nxt[100][100], const double dp[100][100]) {
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) nxt[i][j] = 0;
  double tmp[100][100];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) tmp[i][j] = dp[i][j];
  for (int i = l; i < r; ++i) {
    for (int j = 0; j < n + 1; ++j)
      for (int k = 0; k < n + 1; ++k) nxt[j][k] = 0;
    for (int j = 0; j < n; ++j)
      for (int k = 0; k < n; ++k)
        if (tmp[j][k] > 1e-20) {
          double p = tmp[j][k];
          nxt[j][k] += p * lp[i];
          nxt[j + 1][k] += p * cp[i];
          nxt[j][k + 1] += p * rp[i];
        }
    for (int j = 0; j < n + 1; ++j)
      for (int k = 0; k < n + 1; ++k) tmp[j][k] = nxt[j][k];
  }
}
void rec(int l, int r, double dp[100][100]) {
  if (r - l == 1) {
    for (int i = 0; i < n + 1; ++i)
      for (int j = 0; j < n + 1; ++j) {
        int rest = m - 1 - i - j;
        if (rest + shift >= 0) res[who[l]][rest + shift][i] += dp[i][j] * cp[l];
      }
    return;
  }
  double nxt[100][100];
  int md = (l + r) >> 1;
  calc(md, r, nxt, dp);
  rec(l, md, nxt);
  calc(l, md, nxt, dp);
  rec(md, r, nxt);
}
void solve(int l, int r) {
  m = shift = 0;
  for (int i = 0; i < n; ++i) {
    if (range[i].first <= l && r <= range[i].second) {
      double len = range[i].second - range[i].first;
      double L = min(1.0, max(0, l - range[i].first) / len),
             R = min(1.0, max(0, range[i].second - r) / len), mid = 1 - L - R;
      lp[m] = L;
      cp[m] = mid;
      rp[m] = R;
      who[m] = i;
      ++m;
    } else if (range[i].second <= l)
      ++shift;
  }
  if (m == 0) return;
  double dp[100][100] = {0};
  dp[0][0] = 1;
  rec(0, m, dp);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> range[i].first >> range[i].second;
    zip[i * 2] = range[i].first;
    zip[i * 2 + 1] = range[i].second;
  }
  sort(zip, zip + n * 2);
  zn = unique(zip, zip + n * 2) - zip;
  for (int i = 0; i < zn - 1; ++i) solve(zip[i], zip[i + 1]);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j)
      for (int k = 0; k < n; ++k)
        for (int l = 0; l < k + 1; ++l) ans[i][j + l] += res[i][j][k] / (k + 1);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j)
      printf("%.10f%c", ans[i][j], j == n - 1 ? '\n' : ' ');
  return 0;
}