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;
const int N = 1e5 + 1, MOD = 998244353;
int lim[N][2][2], p[N << 2][2][2], psb[N][2];
inline int qpow(int base, int expo) {
  int ret = 1;
  while (expo) {
    if (expo & 1) ret = 1ll * ret * base % MOD;
    base = 1ll * base * base % MOD;
    expo >>= 1;
  }
  return ret;
}
inline void up(int now, int mid) {
  int i, j, k, l;
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 2; j++) {
      p[now][i][j] = 0;
      for (k = 0; k < 2; k++)
        for (l = 0; l < 2; l++)
          if (!lim[mid][k][l])
            p[now][i][j] =
                (0ll + p[now][i][j] +
                 1ll * p[now << 1][i][k] * p[now << 1 | 1][l][j] % MOD) %
                MOD;
    }
  }
}
void build(int now, int l, int r) {
  if (l == r) {
    p[now][0][0] = psb[l][0];
    p[now][1][1] = psb[l][1];
    return;
  }
  int mid = (l + r) >> 1;
  build(now << 1, l, mid);
  build(now << 1 | 1, mid + 1, r);
  up(now, mid);
}
void update(int now, int l, int r, int qp) {
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (qp <= mid)
    update(now << 1, l, mid, qp);
  else
    update(now << 1 | 1, mid + 1, r, qp);
  up(now, mid);
}
struct chase {
  int x, xp, yp;
  double tim;
  int rtim;
  chase(int x = 0, int xp = 0, int yp = 0, double tim = 0, int rtim = 0)
      : x(x), xp(xp), yp(yp), tim(tim), rtim(rtim) {}
} cs[N * 2];
int csc;
inline int cmp(chase a, chase b) { return a.tim < b.tim; }
int main() {
  int n, i, lasp, lasv, inv = qpow(100, MOD - 2);
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    int tpos, tv;
    scanf("%d%d%d", &tpos, &tv, &psb[i][1]);
    if (i > 1) {
      int dis = tpos - lasp;
      cs[++csc] = chase(i - 1, 1, 0, dis / 1.0 / (tv + lasv),
                        1ll * dis * qpow(tv + lasv, MOD - 2) % MOD);
      if (tv < lasv)
        cs[++csc] = chase(i - 1, 1, 1, dis / 1.0 / (lasv - tv),
                          1ll * dis * qpow(lasv - tv, MOD - 2) % MOD);
      else if (tv > lasv)
        cs[++csc] = chase(i - 1, 0, 0, dis / 1.0 / (tv - lasv),
                          1ll * dis * qpow(tv - lasv, MOD - 2) % MOD);
    }
    psb[i][0] = 1ll * (100 - psb[i][1]) * inv % MOD;
    psb[i][1] = 1ll * psb[i][1] * inv % MOD;
    lasp = tpos, lasv = tv;
  }
  build(1, 1, n);
  sort(cs + 1, cs + csc + 1, cmp);
  int ans = 0, lpsb = 1;
  for (i = 1; i <= csc; i++) {
    lim[cs[i].x][cs[i].xp][cs[i].yp] = 1;
    update(1, 1, n, cs[i].x);
    int tpsb = (0ll + p[1][0][0] + p[1][0][1] + p[1][1][0] + p[1][1][1]) % MOD;
    ans = (0ll + ans + 1ll * cs[i].rtim * (lpsb - tpsb + MOD) % MOD) % MOD;
    lpsb = tpsb;
  }
  printf("%d", ans);
  return 0;
}