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 i64 = long long;
const int N = 100000 + 7;
const i64 MOD = 998244353;
int n, m;
i64 x[N], v[N], p[N];
i64 ans;
struct str {
  int x, u, v;
  i64 t, h;
} e[N << 2];
struct mtr {
  i64 a[2][2];
  mtr(i64 a_ = 0, i64 b_ = 0, i64 c_ = 0, i64 d_ = 0) {
    a[0][0] = a_, a[0][1] = b_, a[1][0] = c_, a[1][1] = d_;
  }
  mtr operator*(const mtr &q) {
    mtr z;
    for (int i = 0; i < 2; ++i)
      for (int j = 0; j < 2; ++j)
        for (int k = 0; k < 2; ++k) z.a[i][j] += a[i][k] * q.a[k][j];
    for (int i = 0; i < 2; ++i)
      for (int j = 0; j < 2; ++j) z.a[i][j] %= MOD;
    return z;
  }
  mtr chg(int x, int y, i64 z) { return a[x][y] = z, *this; }
} dat[N];
struct segtree {
  mtr tr[N << 2];
  void modify(int p, int l, int r, int x, mtr y) {
    if (l == r)
      tr[p] = y;
    else {
      int mid = l + r >> 1;
      x <= mid ? modify(p << 1, l, mid, x, y)
               : modify(p << 1 | 1, mid + 1, r, x, y);
      tr[p] = tr[p << 1] * tr[p << 1 | 1];
    }
  }
} tr;
i64 pow(i64 a, i64 k);
i64 gettime(int x, int y, int u, int v);
int main() {
  const i64 inv100 = pow(100, MOD - 2);
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i)
    scanf("%lld%lld%lld", x + i, v + i, p + i), p[i] = p[i] * inv100 % MOD;
  for (int i = 1; i < n; ++i)
    for (int u = 0; u < 2; ++u)
      for (int v = 0; v < 2; ++v)
        if (gettime(i, i + 1, u, v) != -1)
          e[++m] = (str){i + 1, u, v, x[i + 1] - x[i], gettime(i, i + 1, u, v)};
  std::sort(e + 1, e + m + 1,
            [](str a, str b) { return a.t * b.h < b.t * a.h; });
  for (int i = 1; i <= n; ++i)
    tr.modify(1, 1, n, i, dat[i] = mtr(1 - p[i], p[i], 1 - p[i], p[i]));
  mtr h;
  for (int i = 1; i <= m; ++i)
    h = mtr(),
    tr.modify(1, 1, n, e[i].x,
              h.chg(e[i].u, e[i].v, e[i].v ? p[e[i].x] : 1 - p[e[i].x])),
    (ans += e[i].t * pow(e[i].h, MOD - 2) % MOD *
            (tr.tr[1].a[0][0] + tr.tr[1].a[0][1])) %= MOD,
    tr.modify(1, 1, n, e[i].x, dat[e[i].x].chg(e[i].u, e[i].v, 0));
  (ans += MOD) %= MOD;
  printf("%lld ", ans);
  return 0;
}
i64 pow(i64 a, i64 k) {
  i64 t = 1;
  for (; k; a = a * a % MOD, k >>= 1)
    if (k & 1) t = t * a % MOD;
  return t;
}
i64 gettime(int a, int b, int i, int j) {
  if (i == 0 && j == 1) return -1;
  if (i == 0 && j == 0) return v[a] >= v[b] ? -1 : v[b] - v[a];
  if (i == 1 && j == 1) return v[a] <= v[b] ? -1 : v[a] - v[b];
  return v[a] + v[b];
}