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 char lf = '\n';
template <typename T1, typename T2>
inline T1 max(T1 a, T2 b) {
  return a < b ? b : a;
}
template <typename T1, typename T2>
inline T1 min(T1 a, T2 b) {
  return a < b ? a : b;
}
namespace ae86 {
const int bufl = 1 << 15;
char buf[bufl], *s = buf, *t = buf;
inline int fetch() {
  if (s == t) {
    t = (s = buf) + fread(buf, 1, bufl, stdin);
    if (s == t) return EOF;
  }
  return *s++;
}
inline int ty() {
  int a = 0;
  int b = 1, c = fetch();
  while (!isdigit(c)) b ^= c == '-', c = fetch();
  while (isdigit(c)) a = a * 10 + c - 48, c = fetch();
  return b ? a : -a;
}
}  // namespace ae86
using ae86::ty;
const int _ = 200007, mo = 998244353;
template <typename T1, typename T2>
inline T1 ad(T1 &a, T2 b) {
  return a = a + b >= mo ? a + b - mo : a + b;
}
template <typename T1, typename T2>
inline T1 dl(T1 &a, T2 b) {
  return a = a >= b ? a - b : a - b + mo;
}
template <typename T1, typename T2>
inline T1 add(T1 a, T2 b) {
  return a + b >= mo ? a + b - mo : a + b;
}
template <typename T1, typename T2>
inline T1 del(T1 a, T2 b) {
  return a >= b ? a - b : a - b + mo;
}
long long powa(long long a, long long t) {
  long long b = 1;
  while (t) {
    if (t & 1) b = b * a % mo;
    a = a * a % mo, t >>= 1;
  }
  return b;
}
long long inva(long long a) { return powa(a, mo - 2); }
const int M = 2;
struct martix {
  long long val[M][M];
  martix() { memset(val, 0, sizeof(val)); }
  void be1() {
    memset(val, 0, sizeof(val));
    for (int i = 0; i < M; i++) val[i][i] = 1;
  }
  long long *operator[](int x) { return val[x]; }
  friend martix operator*(martix a, martix b) {
    martix c;
    for (int i = 0; i < M; i++)
      for (int j = 0; j < M; j++)
        for (int k = 0; k < M; k++) ad(c[i][j], a[i][k] * b[k][j] % mo);
    return c;
  }
  long long f() { return add(val[0][0], val[0][1]); }
};
int n;
long long loc[_], spd[_], gai[_];
struct sgt {
  static const int _t = _ << 2;
  martix t[_t];
  void up(int x) { t[x] = t[(x << 1)] * t[(x << 1 | 1)]; }
  void plant(int x, int l, int r) {
    if (l == r) {
      t[x][0][0] = t[x][1][0] = del(1, gai[l]);
      t[x][0][1] = t[x][1][1] = gai[l];
      return;
    }
    plant((x << 1), l, ((l + r) >> 1)),
        plant((x << 1 | 1), ((l + r) >> 1) + 1, r), up(x);
  }
  void change(int x, int l, int r, int tar, int a, int b, long long d) {
    if (l == r) {
      t[x][a][b] = d;
      return;
    }
    if (tar <= ((l + r) >> 1))
      change((x << 1), l, ((l + r) >> 1), tar, a, b, d);
    else
      change((x << 1 | 1), ((l + r) >> 1) + 1, r, tar, a, b, d);
    up(x);
  }
} t;
struct cxk {
  int id, av, bv;
  long long dis, spd;
  cxk(int id_ = 0, int av_ = 0, int bv_ = 0, long long dis_ = 0,
      long long spd_ = 0) {
    id = id_, av = av_, bv = bv_, dis = dis_, spd = spd_;
  }
  friend int operator<(cxk a, cxk b) { return a.dis * b.spd < b.dis * a.spd; }
} stk[_ * 3];
int top = 0;
int main() {
  ios::sync_with_stdio(0), cout.tie(nullptr);
  n = ty();
  for (int i = 1, x = inva(100); i <= n; i++)
    loc[i] = ty(), spd[i] = ty(), gai[i] = 1ll * ty() * x % mo;
  t.plant(1, 1, n);
  for (int i = 1; i < n; i++) {
    long long dis = loc[i + 1] - loc[i];
    stk[++top] = cxk(i + 1, 1, 0, dis, spd[i] + spd[i + 1]);
    if (spd[i] > spd[i + 1])
      stk[++top] = cxk(i + 1, 1, 1, dis, spd[i] - spd[i + 1]);
    if (spd[i + 1] > spd[i])
      stk[++top] = cxk(i + 1, 0, 0, dis, spd[i + 1] - spd[i]);
  }
  sort(stk + 1, stk + top + 1);
  long long ans = 0;
  martix temp;
  temp[0][0] = 1;
  for (int i = 1; i <= top; i++) {
    long long dlt = (temp * t.t[1]).f();
    t.change(1, 1, n, stk[i].id, stk[i].av, stk[i].bv, 0);
    dl(dlt, (temp * t.t[1]).f());
    ad(ans, dlt * stk[i].dis % mo * inva(stk[i].spd) % mo);
  }
  cout << ans << lf;
  return 0;
}