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>
int read() {
  bool flag = true;
  int ch = getchar(), num = 0;
  while (ch < 48 || ch > 57) {
    if (ch == '-') flag = false;
    ch = getchar();
  }
  while (ch >= 48 && ch <= 57)
    num = (num << 3) + (num << 1) + (ch ^ 48), ch = getchar();
  return flag ? num : -num;
}
const long long mod = 998244353;
const int maxn = 100005;
int n, x[maxn], v[maxn], p[maxn][2];
bool limit[maxn][2][2];
long long val[maxn << 2][2][2];
int mid[maxn << 2], id[maxn];
void pushup(int u) {
  int i, j, x, y;
  for (i = 0; i < 2; i++)
    for (j = 0; j < 2; j++) {
      val[u][i][j] = 0;
      for (x = 0; x < 2; x++)
        for (y = 0; y < 2; y++)
          if (!limit[mid[u]][x][y])
            val[u][i][j] += val[u << 1][i][x] * val[u << 1 | 1][y][j] % mod;
      val[u][i][j] %= mod;
    }
}
void build(int u, int l, int r) {
  if (l == r) {
    val[u][0][0] = p[l][0];
    val[u][1][1] = p[l][1];
    return;
  }
  int m = (l + r) >> 1;
  mid[u] = m;
  id[m] = u;
  build(u << 1, l, m);
  build(u << 1 | 1, m + 1, r);
  pushup(u);
}
struct Node {
  int x, d1, d2, l, v;
} c[maxn << 1];
bool operator<(Node a, Node b) {
  return (long long)a.l * b.v < (long long)b.l * a.v;
}
long long inv[2000005];
int main() {
  inv[1] = 1;
  for (int i = 2; i <= 2000000; i++)
    inv[i] = (mod - mod / i) * inv[mod % i] % mod;
  const long long inv100 = inv[100];
  n = read();
  for (int i = 1; i <= n; i++) {
    x[i] = read(), v[i] = read(), p[i][1] = read();
    p[i][1] = p[i][1] * inv100 % mod;
    p[i][0] = (1 - p[i][1] + mod) % mod;
  }
  build(1, 1, n);
  int m = 0;
  for (int i = 2; i <= n; i++) {
    c[m++] = Node{i - 1, 1, 0, x[i] - x[i - 1], v[i - 1] + v[i]};
    if (v[i - 1] > v[i])
      c[m++] = Node{i - 1, 1, 1, x[i] - x[i - 1], v[i - 1] - v[i]};
    else if (v[i - 1] < v[i])
      c[m++] = Node{i - 1, 0, 0, x[i] - x[i - 1], v[i] - v[i - 1]};
  }
  std::sort(c, c + m);
  long long answer = 0ll, last = 1ll, now;
  for (int i = 0; i < m; i++) {
    limit[c[i].x][c[i].d1][c[i].d2] = true;
    for (int u = id[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;
    answer += c[i].l * inv[c[i].v] % mod * (last - now + mod) % mod;
    last = now;
  }
  printf("%lld", answer % mod);
  return 0;
}