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;
inline char nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int in() {
  int x = 0, f = 1;
  char ch = nc();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = nc();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - 48, ch = nc();
  return x * f;
}
const int N = 1e5 + 10, mod = 998244353;
int n, x[N], v[N], p[N][2], p0[N], s[N];
int qpow(int a, int b) {
  int c = 1;
  while (b) {
    if (b & 1) c = 1ll * c * a % mod;
    a = 1ll * a * a % mod;
    b >>= 1;
  }
  return c;
}
long long ans;
struct seg {
  int s[2][2];
} tr[N * 4], now, an, bn;
seg mul(seg A, seg B) {
  seg C;
  C.s[0][0] = C.s[0][1] = C.s[1][0] = C.s[1][1] = 0;
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 2; ++j)
      for (int k = 0; k < 2; ++k)
        (C.s[i][j] += 1ll * A.s[i][k] * B.s[k][j] % mod) %= mod;
  return C;
}
void build(int o, int l, int r) {
  if (l == r) {
    tr[o].s[0][0] = tr[o].s[1][0] = p[l][0];
    tr[o].s[0][1] = tr[o].s[1][1] = p[l][1];
    return;
  }
  int mid = (l + r) >> 1;
  build((o << 1), l, mid);
  build((o << 1 | 1), mid + 1, r);
  tr[o] = mul(tr[(o << 1)], tr[(o << 1 | 1)]);
}
void solve(int o, int l, int r, int x, int op) {
  if (l == r) {
    if (op == 3) {
      tr[o] = now;
      return;
    }
    now = tr[o];
    tr[o].s[0][0] = tr[o].s[0][1] = tr[o].s[1][0] = tr[o].s[1][1] = 0;
    if (op == 0)
      tr[o].s[1][0] = p[l][0];
    else if (op == 1)
      tr[o].s[0][0] = p[l][0];
    else if (op == 2)
      tr[o].s[1][1] = p[l][1];
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    solve((o << 1), l, mid, x, op);
  else
    solve((o << 1 | 1), mid + 1, r, x, op);
  tr[o] = mul(tr[(o << 1)], tr[(o << 1 | 1)]);
}
void upd(int o, int l, int r, int x, int op) {
  if (l == r) {
    if (op == 0)
      tr[o].s[1][0] = 0;
    else if (op == 1)
      tr[o].s[0][0] = 0;
    else if (op == 2)
      tr[o].s[1][1] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    upd((o << 1), l, mid, x, op);
  else
    upd((o << 1 | 1), mid + 1, r, x, op);
  tr[o] = mul(tr[(o << 1)], tr[(o << 1 | 1)]);
}
struct node {
  int s, v, x, id;
  bool operator<(const node B) const { return 1ll * s * B.v < 1ll * B.s * v; }
} t[N * 3];
int m;
int main() {
  n = in();
  if (n == 1) {
    printf("0\n");
    return 0;
  }
  for (int i = 1; i <= n; ++i) x[i] = in(), v[i] = in(), p0[i - 1] = in();
  for (int i = 0; i < n; ++i) {
    p[i][1] = 1ll * p0[i] * qpow(100, mod - 2) % mod;
    p[i][0] = 1ll * (100 - p0[i]) * qpow(100, mod - 2) % mod;
  }
  an.s[0][0] = p[0][0];
  an.s[0][1] = p[0][1];
  for (int i = 1; i < n; ++i) {
    s[i] = x[i + 1] - x[i];
    t[++m] = (node){s[i], v[i + 1] + v[i], i, 0};
    if (v[i + 1] > v[i]) t[++m] = (node){s[i], v[i + 1] - v[i], i, 1};
    if (v[i + 1] < v[i]) t[++m] = (node){s[i], v[i] - v[i + 1], i, 2};
  }
  build(1, 1, n - 1);
  sort(t + 1, t + 1 + m);
  for (int i = 1; i <= m; ++i) {
    solve(1, 1, n - 1, t[i].x, t[i].id);
    bn = mul(an, tr[1]);
    ans += 1ll * t[i].s * qpow(t[i].v, mod - 2) % mod *
           (bn.s[0][0] + bn.s[0][1]) % mod;
    ans %= mod;
    solve(1, 1, n - 1, t[i].x, 3);
    upd(1, 1, n - 1, t[i].x, t[i].id);
  }
  printf("%lld\n", ans);
  return 0;
}