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>
#pragma GCC optimize("Ofast")
using namespace std;
const int maxN = 1 << 17, maxTS = maxN * 2, mod = 998244353;
template <class T1, class T2>
inline void addMod(T1& a, T2 b) {
  a = (a + b) % mod;
}
template <class T1, class T2>
inline void multMod(T1& a, T2 b) {
  a = a * b % mod;
}
long long qpow(long long a, long long b) {
  long long res0 = 1;
  for (; b != 0; b >>= 1) {
    if (b & 1) multMod(res0, a);
    multMod(a, a);
  }
  return res0;
}
struct Tree {
  int offset, rt[maxTS];
  long long P[maxTS][2][2];
  bool bent[maxTS][2][2];
  void calc(int v, int m) {
    for (int a = (0); a < (int)(2); a++)
      for (int b = (0); b < (int)(2); b++) {
        P[v][a][b] = 0;
        for (int c = (0); c < (int)(2); c++)
          for (int d = (0); d < (int)(2); d++)
            if (!bent[m][c][d])
              P[v][a][b] += P[v * 2][a][c] * P[v * 2 + 1][d][b];
        P[v][a][b] %= mod;
      }
  }
  void init(int n, long long* p) {
    for (offset = 1; offset < n; offset *= 2)
      ;
    for (int i = (offset); i < (int)(offset * 2); i++) {
      rt[i] = i;
      long long pp = p[i - offset];
      P[i][0][0] = (mod + 1 - pp) % mod;
      P[i][1][1] = pp;
    }
    for (int i = offset - 1; i > (int)(0); i--)
      rt[i] = rt[i * 2 + 1], calc(i, rt[i * 2]);
  }
  long long tak() {
    return (P[1][0][0] + P[1][0][1] + P[1][1][0] + P[1][1][1]) % mod;
  }
  void go(int v, int x) {
    assert(v < offset);
    int m = rt[v * 2];
    if (x < m) go(v * 2, x);
    if (x > m) go(v * 2 + 1, x);
    calc(v, m);
  }
  void ban(int v, int a, int b) {
    v += offset;
    bent[v][a][b] = true;
    go(1, v);
  }
} tree;
struct Boom {
  int i, s, v, m;
  Boom(int a = 0, int b = 0, int c = 0, int d = 0) : i(a), s(b), v(c), m(d) {}
} T[maxN * 4];
bool cmp(int i, int j) { return 1ll * T[i].s * T[j].v < 1ll * T[j].s * T[i].v; }
long long P[maxN];
int x[maxN], v[maxN], inds[maxN * 4];
int main() {
  int n;
  scanf("%d", &n);
  long long oneHtd = qpow(100ll, mod - 2);
  for (int i = (0); i < (int)(n); i++) {
    scanf("%d%d%lld", x + i, v + i, P + i);
    multMod(P[i], oneHtd);
  }
  int m = 0;
  for (int i = (0); i < (int)(n - 1); i++) {
    int s = x[i + 1] - x[i];
    T[m++] = {i, s, v[i] + v[i + 1], 1};
    if (v[i] < v[i + 1]) T[m++] = {i, s, v[i + 1] - v[i], 0};
    if (v[i] > v[i + 1]) T[m++] = {i, s, v[i] - v[i + 1], 3};
  }
  iota(inds, inds + m, 0);
  sort(inds, inds + m, cmp);
  inds[m] = m;
  T[m] = {0, 2000000000, 1, 0};
  tree.init(n, P);
  long long res = 0;
  for (int j = (0); j < (int)(m); j++) {
    int i = inds[j];
    long long p = tree.tak();
    int m = T[i].m;
    ;
    tree.ban(T[i].i, m & 1, m / 2 & 1);
    addMod(p, mod - tree.tak());
    multMod(p, T[i].s);
    multMod(p, qpow(T[i].v, mod - 2));
    addMod(res, p);
  }
  printf("%lld\n", res);
  return 0;
}