Problem: An infinitely long Line Chillland Collider (LCC) was built in Chillland. There are n pipes with coordinates x_i that are connected to LCC. When the experiment starts at time 0, i-th proton flies from the i-th pipe with speed v_i. It flies to the right with probability p_i and flies to the left with probability (1 - p_i). The duration of the experiment is determined as the time of the first collision of any two protons. In case there is no collision, the duration of the experiment is considered to be zero.

Find the expected value of the duration of the experiment.

<image>Illustration for the first example

Input

The first line of input contains one integer n — the number of pipes (1 ≤ n ≤ 10^5). Each of the following n lines contains three integers x_i, v_i, p_i — the coordinate of the i-th pipe, the speed of the i-th proton and the probability that the i-th proton flies to the right in percentage points (-10^9 ≤ x_i ≤ 10^9, 1 ≤ v ≤ 10^6, 0 ≤ p_i ≤ 100). It is guaranteed that all x_i are distinct and sorted in increasing order.

Output

It's possible to prove that the answer can always be represented as a fraction P/Q, where P is an integer and Q is a natural number not divisible by 998 244 353. In this case, print P ⋅ Q^{-1} modulo 998 244 353.

Examples

Input


2
1 1 100
3 1 0


Output


1


Input


3
7 10 0
9 4 86
14 5 100


Output


0


Input


4
6 4 50
11 25 50
13 16 50
15 8 50


Output


150902884

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long dist[101000], vel[101000], prob[101000], tree[4 * 101000][2][2],
    tmp[2][2];
long long fp(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) r = ((r % 998244353) * (a % 998244353)) % 998244353;
    a = ((a % 998244353) * (a % 998244353)) % 998244353;
    b >>= 1;
  }
  return r;
}
struct pp {
  long long dist, vel, ind, d1, d2;
  bool operator<(const pp &p) const { return p.vel * dist < p.dist * vel; }
} col[4 * 101000];
void comp(int node) {
  int i, j, k;
  for (i = 0; i < 2; i++)
    for (j = 0; j < 2; j++) tree[node][i][j] = 0;
  for (i = 0; i < 2; i++)
    for (k = 0; k < 2; k++)
      for (j = 0; j < 2; j++)
        tree[node][i][j] = (tree[node][i][j] +
                            tree[2 * node][i][k] * tree[2 * node + 1][k][j]) %
                           998244353;
}
void init(int node, int l, int r) {
  if (l == r) {
    tree[node][0][0] = tree[node][1][0] = (1 - prob[l] + 998244353) % 998244353;
    tree[node][0][1] = tree[node][1][1] = prob[l] % 998244353;
    if (l == 1) tree[node][1][0] = tree[node][1][1] = 0;
    return;
  }
  init(2 * node, l, (l + r) / 2);
  init(2 * node + 1, (l + r) / 2 + 1, r);
  comp(node);
}
void update(int node, int l, int r, int d1, int d2, int ind, int fl) {
  if (l == r) {
    int i, j;
    if (fl) {
      for (i = 0; i < 2; i++) {
        for (j = 0; j < 2; j++) {
          if (i != d1 || j != d2) {
            tmp[i][j] = tree[node][i][j];
            tree[node][i][j] = 0;
          }
        }
      }
    } else {
      for (i = 0; i < 2; i++) {
        for (j = 0; j < 2; j++) {
          if (i != d1 || j != d2)
            tree[node][i][j] = tmp[i][j];
          else
            tree[node][i][j] = 0;
        }
      }
    }
    return;
  }
  if (ind <= (l + r) / 2)
    update(2 * node, l, (l + r) / 2, d1, d2, ind, fl);
  else
    update(2 * node + 1, (l + r) / 2 + 1, r, d1, d2, ind, fl);
  comp(node);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int i;
  long long hinv = fp(100, 998244353 - 2);
  for (i = 1; i <= n; i++) {
    cin >> dist[i] >> vel[i] >> prob[i];
    prob[i] = ((prob[i] % 998244353) * (hinv % 998244353)) % 998244353;
  }
  int pr = 0;
  for (i = 1; i < n; i++) {
    col[pr++] = {dist[i + 1] - dist[i], vel[i + 1] + vel[i], i, 1, 0};
    if (vel[i + 1] > vel[i])
      col[pr++] = {dist[i + 1] - dist[i], vel[i + 1] - vel[i], i, 0, 0};
    else
      col[pr++] = {dist[i + 1] - dist[i], vel[i] - vel[i + 1], i, 1, 1};
  }
  sort(col, col + pr);
  init(1, 1, n);
  long long time, ind, ans = 0;
  for (i = 0; i < pr; i++) {
    time = (col[i].dist * fp(col[i].vel, 998244353 - 2)) % 998244353;
    ind = col[i].ind;
    update(1, 1, n, col[i].d1, col[i].d2, ind + 1, 1);
    ans = (ans + (tree[1][0][0] + tree[1][0][1]) * time) % 998244353;
    update(1, 1, n, col[i].d1, col[i].d2, ind + 1, 0);
  }
  cout << ans << endl;
}