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;
const int INF = 0x3f3f3f3f;
const long long mod = 998244353;
const int N = 100005;
long long pow_mod(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}
const long long inv100 = pow_mod(100, mod - 2);
int a[N], b[N], p[N][2];
struct Node {
  int x, d1, d2, L, v;
} c[N * 2];
bool cmp(const Node &p1, const Node &p2) {
  return (long long)p1.L * p2.v < (long long)p2.L * p1.v;
}
bool limit[N][2][2];
long long val[N << 2][2][2];
int umid[N << 2];
int wz[N];
void push_up(int u) {
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      val[u][i][j] = 0;
      for (int x = 0; x < 2; x++) {
        for (int y = 0; y < 2; y++) {
          if (!limit[umid[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 mid = l + r >> 1;
  umid[u] = mid;
  wz[mid] = u;
  build(u << 1, l, mid);
  build(u << 1 | 1, mid + 1, r);
  push_up(u);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d", &a[i], &b[i], &p[i][1]);
    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++] = {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, c + m, cmp);
  long long ans = 0;
  for (int i = 0; i < m; i++) {
    bool tmp[2][2];
    for (int j = 0; j < 2; j++) {
      for (int k = 0; k < 2; k++) {
        tmp[j][k] = limit[c[i].x][j][k];
        limit[c[i].x][j][k] = !(j == c[i].d1 && k == c[i].d2);
      }
    }
    for (int u = wz[c[i].x]; u; u >>= 1) {
      push_up(u);
    }
    long long now =
        (val[1][0][0] + val[1][0][1] + val[1][1][0] + val[1][1][1]) % mod;
    ans += c[i].L * pow_mod(c[i].v, mod - 2) % mod * now % mod;
    for (int j = 0; j < 2; j++) {
      for (int k = 0; k < 2; k++) {
        limit[c[i].x][j][k] = tmp[j][k];
      }
    }
    limit[c[i].x][c[i].d1][c[i].d2] = 1;
    for (int u = wz[c[i].x]; u; u >>= 1) {
      push_up(u);
    }
  }
  printf("%lld\n", ans % mod);
  return 0;
}