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;
namespace fast_io {
char buf[1 << 12], *p1 = buf, *p2 = buf, sr[1 << 23], z[23], nc;
int C = -1, Z = 0, Bi = 0, ny;
inline char gc() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 12, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int read() {
  int x = 0;
  ny = 1;
  while (nc = gc(), (nc < 48 || nc > 57) && nc != EOF)
    if (nc == 45) ny = -1;
  Bi = 1;
  if (nc < 0) return nc;
  x = nc - 48;
  while (nc = gc(), 47 < nc && nc < 58 && nc != EOF)
    x = (x << 3) + (x << 1) + (nc ^ 48), Bi++;
  return x * ny;
}
inline double gf() {
  int a = read(), y = ny, b = (nc != '.') ? 0 : read();
  return (b ? a + (double)b / pow(10, Bi) * y : a);
}
inline int gs(char *s) {
  char c, *t = s;
  while (c = gc(), c <= 32)
    ;
  *s++ = c;
  while (c = gc(), c > 32) *s++ = c;
  return s - t;
}
inline void ot() {
  fwrite(sr, 1, C + 1, stdout);
  C = -1;
}
inline void flush() {
  if (C > 1 << 22) ot();
}
template <typename T>
inline void write(T x, char t) {
  int y = 0;
  if (x < 0) y = 1, x = -x;
  while (z[++Z] = x % 10 + 48, x /= 10)
    ;
  if (y) z[++Z] = '-';
  while (sr[++C] = z[Z], --Z)
    ;
  sr[++C] = t;
  flush();
}
inline void write(char *s) {
  int l = strlen(s);
  for (int i = 0; i < l; i++) sr[++C] = *s++;
  sr[++C] = '\n';
  flush();
}
};  // namespace fast_io
using namespace fast_io;
const int N = 1e5 + 5, p = 998244353;
int n, m, ans, la, a[N], b[N], q[N][2], vis[N][2][2], s[N << 2][2][2],
    md[N << 2], bl[N];
struct did {
  int x, i, j, l, v;
} c[N * 2];
inline void M(int &x) {
  x -= p;
  x += x >> 31 & p;
}
inline int qpow(int a, int b) {
  int c = 1;
  for (; b; b >>= 1, a = 1ll * a * a % p)
    if (b & 1) c = 1ll * a * c % p;
  return c;
}
inline void up(int u) {
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++) {
      s[u][i][j] = 0;
      for (int x = 0; x < 2; x++)
        for (int y = 0; y < 2; y++)
          if (!vis[md[u]][x][y])
            M(s[u][i][j] +=
              1ll * s[(u << 1)][i][x] * s[(u << 1 | 1)][y][j] % p);
    }
}
void build(int p, int l, int r) {
  if (l == r) return s[p][0][0] = q[l][0], s[p][1][1] = q[l][1], void();
  md[p] = ((l + r) >> 1), bl[((l + r) >> 1)] = p,
  build((p << 1), l, ((l + r) >> 1)),
  build((p << 1 | 1), ((l + r) >> 1) + 1, r), up(p);
}
int main() {
  n = read();
  int iv = qpow(100, p - 2);
  for (int i = 1; i <= n; i++)
    a[i] = read(), b[i] = read(), q[i][1] = 1ll * iv * read() % p,
    M(q[i][0] = p + 1 - q[i][1]);
  build(1, 1, n);
  for (int i = 2; i <= n; i++) {
    c[++m] = {i - 1, 1, 0, a[i] - a[i - 1], b[i - 1] + b[i]};
    if (b[i - 1] > b[i])
      c[++m] = {i - 1, 1, 1, a[i] - a[i - 1], b[i - 1] - b[i]};
    if (b[i - 1] < b[i])
      c[++m] = {i - 1, 0, 0, a[i] - a[i - 1], b[i] - b[i - 1]};
  }
  sort(c + 1, c + m + 1,
       [](did a, did b) { return 1ll * a.l * b.v < 1ll * b.l * a.v; });
  for (int i = la = 1; i <= m; i++) {
    vis[c[i].x][c[i].i][c[i].j] = 1;
    for (int u = bl[c[i].x]; u; u >>= 1) up(u);
    int tmp = (0ll + s[1][0][0] + s[1][0][1] + s[1][1][0] + s[1][1][1]) % p;
    M(ans += 1ll * c[i].l * qpow(c[i].v, p - 2) % p * (la - tmp + p) % p),
        la = tmp;
  }
  write(ans, '\n');
  return ot(), 0;
}