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;
long long n;
const long long N = 1e5 + 100;
long long x[N], v1[N], p[N][2];
const long long mod = 998244353;
long long power(long long a, long long b) {
  if (b == 0) {
    return 1;
  }
  if (b % 2 == 0) {
    long long t = power(a, b / 2);
    return t * t % mod;
  }
  return a * power(a, b - 1) % mod;
}
struct node {
  long long id;
  bool d1, d2;
  long long x, y;
} cra[N << 1];
bool cmp(node a, node b) { return a.x * b.y < b.x * a.y; }
struct matrix {
  long long a[2][2];
  matrix operator*(const matrix x1) const {
    matrix res;
    for (long long i = 0; i < 2; i++) {
      for (long long j = 0; j < 2; j++) {
        res.a[i][j] = 0;
        for (long long k = 0; k < 2; k++) {
          res.a[i][j] = (res.a[i][j] + a[i][k] * x1.a[k][j]) % mod;
        }
      }
    }
    return res;
  }
} lim[N];
matrix Tree[N << 2];
void build(long long v, long long l, long long r) {
  if (l == r) {
    Tree[v] = lim[l];
    return;
  }
  long long m = (r + l) / 2;
  build(v * 2, l, m);
  build(v * 2 + 1, m + 1, r);
  Tree[v] = Tree[v * 2] * Tree[v * 2 + 1];
}
void update(long long v, long long l, long long r, long long idx, matrix val) {
  if (l == r) {
    Tree[v] = val;
    return;
  }
  long long m = (r + l) / 2;
  if (idx <= m) {
    update(v * 2, l, m, idx, val);
  } else {
    update(v * 2 + 1, m + 1, r, idx, val);
  }
  Tree[v] = Tree[v * 2] * Tree[v * 2 + 1];
}
signed main() {
  cin >> n;
  if (n == 1) {
    cout << 0;
    return 0;
  }
  long long tot = 0;
  long long inv = power(100, mod - 2);
  for (long long i = 1; i <= n; i++) {
    cin >> x[i] >> v1[i] >> p[i][1];
    p[i][1] = p[i][1] * inv % mod;
    p[i][0] = (1 - p[i][1] + mod) % mod;
    if (i > 1) {
      cra[++tot] = (node){i, 1, 0, x[i] - x[i - 1], v1[i] + v1[i - 1]};
      if (v1[i - 1] > v1[i]) {
        cra[++tot] = (node){i, 1, 1, x[i] - x[i - 1], v1[i - 1] - v1[i]};
      }
      if (v1[i] > v1[i - 1]) {
        cra[++tot] = (node){i, 0, 0, x[i] - x[i - 1], v1[i] - v1[i - 1]};
      }
    }
  }
  sort(cra + 1, cra + tot + 1, cmp);
  lim[1].a[0][0] = p[1][0];
  lim[1].a[0][1] = p[1][1];
  lim[1].a[1][0] = lim[1].a[1][1] = 0;
  for (long long i = 2; i <= n; i++) {
    lim[i].a[0][0] = lim[i].a[1][0] = p[i][0];
    lim[i].a[0][1] = lim[i].a[1][1] = p[i][1];
  }
  long long ans = 0;
  build(1, 1, n);
  long long last = 1;
  for (long long i = 1; i <= tot; i++) {
    long long id = cra[i].id;
    long long tim = cra[i].x * power(cra[i].y, mod - 2) % mod;
    lim[id].a[cra[i].d1][cra[i].d2] = 0;
    update(1, 1, n, id, lim[id]);
    long long p = (Tree[1].a[0][0] + Tree[1].a[0][1]) % mod;
    ans = (ans + tim * (last - p + mod)) % mod;
    last = p;
  }
  cout << ans;
  return 0;
}