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 long long Maxn = 1e5 + 5;
const long long inf = 1e18, Mod = 998244353;
struct node {
  long long x, d1, d2, s, v;
} c[Maxn << 1];
long long n, m, ans, a[Maxn], b[Maxn], p[Maxn][2], val[Maxn << 2][2][2];
long long w[Maxn << 2], umid[Maxn << 2];
bool lit[Maxn][2][2];
long long qpow(long long x, long long k) {
  long long res = 1;
  while (k) {
    if (k & 1) res = res * x % Mod;
    k >>= 1;
    x = x * x % Mod;
  }
  return res;
}
void pushup(long long u) {
  for (long long i = 0; i < 2; i++)
    for (long long j = 0; j < 2; j++) {
      val[u][i][j] = 0;
      for (long long x = 0; x < 2; x++)
        for (long long y = 0; y < 2; y++)
          if (!lit[umid[u]][x][y])
            val[u][i][j] = (val[u][i][j] +
                            (val[u << 1][i][x] * val[u << 1 | 1][y][j]) % Mod) %
                           Mod;
    }
}
void build(long long l, long long r, long long u) {
  if (l == r) {
    val[u][0][0] = p[l][0];
    val[u][1][1] = p[l][1];
    return;
  }
  long long mid = (l + r) >> 1;
  umid[u] = mid;
  w[mid] = u;
  build(l, mid, u << 1);
  build(mid + 1, r, u << 1 | 1);
  pushup(u);
}
bool cmp(node x, node y) { return x.s * y.v < y.s * x.v; }
int main() {
  long long inv100 = qpow(100, Mod - 2);
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld%lld%lld", &a[i], &b[i], &p[i][1]);
    p[i][1] = p[i][1] * inv100 % Mod;
    p[i][0] = (1 - p[i][1] + Mod) % Mod;
  }
  build(1, n, 1);
  for (long long i = 2; i <= n; i++) {
    c[++m] = (node){i - 1, 1, 0, a[i] - a[i - 1], b[i - 1] + b[i]};
    if (b[i - 1] > b[i])
      c[++m] = (node){i - 1, 1, 1, a[i] - a[i - 1], b[i - 1] - b[i]};
    if (b[i - 1] < b[i])
      c[++m] = (node){i - 1, 0, 0, a[i] - a[i - 1], b[i] - b[i - 1]};
  }
  sort(c + 1, c + 1 + m, cmp);
  long long lst = 1, now;
  for (long long i = 1; i <= m; i++) {
    lit[c[i].x][c[i].d1][c[i].d2] = 1;
    for (long long u = w[c[i].x]; u; u >>= 1) pushup(u);
    now = (val[1][0][0] + val[1][0][1] + val[1][1][0] + val[1][1][1]) % Mod;
    ans =
        (ans + c[i].s * qpow(c[i].v, Mod - 2) % Mod * (lst - now + Mod) % Mod) %
        Mod;
    lst = now;
  }
  printf("%lld\n", ans);
  return 0;
}