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;
int read() {
  int x = 0, sgn = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') sgn = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48);
  return x * sgn;
}
const int mod = 998244353;
long long qp(long long x, int t) {
  long long res = 1;
  for (; t; t >>= 1, x = x * x % mod)
    if (t & 1) res = res * x % mod;
  return res;
}
const int N = 2e5 + 10;
const int inv100 = qp(100, mod - 2);
int n, x[N], v[N], p[N][2], m, wm[N << 2], mw[N << 2];
long long val[N << 2][2][2];
bool lim[N][2][2];
struct LCC {
  int x, d1, d2, l, vv;
} c[N];
bool operator<(LCC a, LCC b) { return 1ll * a.l * b.vv < 1ll * b.l * a.vv; }
void pushup(int o) {
  for (int l1 = 0; l1 < 2; l1++)
    for (int r2 = 0; r2 < 2; r2++) {
      val[o][l1][r2] = 0;
      for (int l2 = 0; l2 < 2; l2++)
        for (int r1 = 0; r1 < 2; r1++)
          if (!lim[wm[o]][l2][r1])
            (val[o][l1][r2] +=
             val[o << 1][l1][l2] * val[o << 1 | 1][r1][r2] % mod) %= mod;
    }
}
void build(int o = 1, int l = 1, int r = n) {
  if (l == r) return val[o][0][0] = p[l][0], val[o][1][1] = p[l][1], void();
  int mid = l + r >> 1;
  build(o << 1, l, mid);
  build(o << 1 | 1, mid + 1, r);
  mw[mid] = o, wm[o] = mid;
  pushup(o);
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++)
    x[i] = read(), v[i] = read(), p[i][1] = 1ll * read() * inv100 % mod,
    p[i][0] = (1 + mod - p[i][1]) % mod;
  for (int i = 1; i < n; i++) {
    c[++m] = (LCC){i, 1, 0, x[i + 1] - x[i], v[i] + v[i + 1]};
    if (v[i] < v[i + 1])
      c[++m] = (LCC){i, 0, 0, x[i + 1] - x[i], v[i + 1] - v[i]};
    if (v[i] > v[i + 1])
      c[++m] = (LCC){i, 1, 1, x[i + 1] - x[i], v[i] - v[i + 1]};
  }
  build();
  sort(c + 1, c + m + 1);
  long long las = 1, ans = 0;
  for (int i = 1; i <= m; i++) {
    lim[c[i].x][c[i].d1][c[i].d2] = 1;
    for (int o = mw[c[i].x]; o; o >>= 1) pushup(o);
    long long now =
        (val[1][0][0] + val[1][1][0] + val[1][0][1] + val[1][1][1]) % mod;
    ans = (ans + (las - now + mod) % mod * c[i].l % mod * qp(c[i].vv, mod - 2) %
                     mod) %
          mod;
    las = now;
  }
  printf("%lld\n", ans);
  return 0;
}