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>
const long long mod = 119 << 23 | 1;
long long qpow(long long x, long long k) {
  long long r = 1;
  for (; k; k >>= 1, (x *= x) %= mod)
    if (k & 1) (r *= x) %= mod;
  return r;
}
int n;
struct matrix {
  int a, b, c, d;
  matrix(int _a = 1, int _b = 0, int _c = 0, int _d = 1) {
    a = _a, b = _b, c = _c, d = _d;
  }
};
matrix operator*(matrix x, matrix y) {
  return matrix((x.a * 1ll * y.a + x.b * 1ll * y.c) % mod,
                (x.a * 1ll * y.b + x.b * 1ll * y.d) % mod,
                (x.c * 1ll * y.a + x.d * 1ll * y.c) % mod,
                (x.c * 1ll * y.b + x.d * 1ll * y.d) % mod);
}
struct segtree {
  matrix mt[1111111];
  void pushu(int p) { mt[p] = mt[p << 1 | 1] * mt[p << 1]; }
  void updata(int f, const matrix& y, int p = 1, int l = 1, int r = n - 1) {
    if (l == r) {
      mt[p] = y;
      return;
    }
    int mid = (l + r) >> 1, dir = f > mid;
    (dir ? l = mid + 1 : r = mid), updata(f, y, p << 1 | dir, l, r), pushu(p);
  }
} T;
matrix ini[111111];
struct pii {
  double t;
  int x, op, modl;
} p[1111111];
bool operator<(const pii x, const pii y) { return x.t < y.t; }
int top;
void push(double t, int x, int y, int M) { p[++top] = (pii){t, x, y, M}; }
int X[1111111], V[1111111], q[1111111];
int main() {
  scanf("%d", &n);
  register int i;
  const int prob = qpow(100, mod - 2);
  for (i = 1; i <= n; i++)
    scanf("%d%d%d", X + i, V + i, q + i), q[i] = q[i] * 1ll * prob % mod;
  for (i = 1; i < n; i++) {
    ini[i] = matrix(q[i + 1], q[i + 1], mod + 1 - q[i + 1], mod + 1 - q[i + 1]),
    T.updata(i, ini[i]);
    push((X[i + 1] - X[i]) * 1.0 / (V[i] + V[i + 1]), i, 3,
         qpow(V[i] + V[i + 1], mod - 2) * 1ll * (X[i + 1] - X[i]) % mod);
    if (V[i] > V[i + 1])
      push((X[i + 1] - X[i]) * 1.0 / (V[i] - V[i + 1]), i, 1,
           qpow(V[i] - V[i + 1], mod - 2) * 1ll * (X[i + 1] - X[i]) % mod);
    else if (V[i + 1] > V[i])
      push((X[i + 1] - X[i]) * 1.0 / (V[i + 1] - V[i]), i, 4,
           qpow(V[i + 1] - V[i], mod - 2) * 1ll * (X[i + 1] - X[i]) % mod);
  }
  std::sort(p + 1, p + top + 1);
  long long ans = 0;
  matrix beg = matrix(q[1], 0, mod + 1 - q[1], 0);
  for (i = 1; i <= top; i++) {
    int g = p[i].x;
    matrix Lim = ini[g];
    if (p[i].op == 1) ini[g].a = Lim.b = Lim.c = Lim.d = 0;
    if (p[i].op == 3) Lim.a = Lim.b = ini[g].c = Lim.d = 0;
    if (p[i].op == 4) Lim.a = Lim.b = Lim.c = ini[g].d = 0;
    T.updata(g, Lim);
    matrix E = T.mt[1] * beg;
    ans += (E.a + E.c) * 1ll * p[i].modl % mod, T.updata(g, ini[g]);
  }
  printf("%lld\n", ans % mod);
}