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>
template <class T1, class T2>
inline bool cmin(T1 &a, const T2 &b) {
  return b < a ? (a = b, true) : false;
}
template <class T1, class T2>
inline bool cmax(T1 &a, const T2 &b) {
  return a < b ? (a = b, true) : false;
}
template <class Type>
Type read() {
  Type a;
  bool b;
  unsigned char c;
  while (c = getchar() - 48, (c > 9) & (c != 253))
    ;
  for (a = (b = c == 253) ? 0 : c; (c = getchar() - 48) <= 9; a = a * 10 + c)
    ;
  return b ? -a : a;
}
auto rd = read<int>;
const unsigned P = 998244353;
unsigned &inc(unsigned &a, unsigned b) { return (a += b) < P ? a : (a -= P); }
unsigned &dec(unsigned &a, unsigned b) {
  return (a -= b) & 0x80000000 ? (a += P) : a;
}
unsigned sum(unsigned a, unsigned b) { return inc(a, b); }
unsigned dif(unsigned a, unsigned b) { return dec(a, b); }
unsigned long long power(unsigned long long a, unsigned b) {
  unsigned long long res = 1;
  for (; b; a = a * a % P, b /= 2)
    if (b % 2 == 1) res = res * a % P;
  return res;
}
struct Event {
  unsigned num, den;
  int pos;
  bool face;
  bool operator<(const Event &o) const {
    return (unsigned long long)num * o.den < (unsigned long long)den * o.num;
  }
};
struct Data {
  unsigned sum, lp, rp;
};
const int N = 1e5 + 1;
const unsigned long long percent = power(100, P - 2);
const Data E = {0, 1, 1};
int n, off, x[N], v[N], l[N], r[N], id[N];
unsigned p[N];
Data zkw[1 << 18];
std::vector<Event> e;
Data operator+(const Data &a, const Data &b) {
  Data res;
  res.sum =
      ((unsigned long long)a.sum * b.rp + (unsigned long long)b.sum * a.lp) % P;
  res.lp = (unsigned long long)a.lp * b.lp % P;
  res.rp = (unsigned long long)a.rp * b.rp % P;
  return res;
}
unsigned query(int l, int r) {
  Data resl = zkw[l += off], resr = E;
  for (r += off; l ^ r ^ 1; l /= 2, r /= 2) {
    if (~l & 1) resl = resl + zkw[l ^ 1];
    if (r & 1) resr = zkw[r ^ 1] + resr;
  }
  resl = resl + resr;
  return sum(resl.sum, resl.rp);
}
int main() {
  unsigned last = 0, prob = 1, ans = 0;
  n = rd();
  for (int i = 0; i < n; ++i)
    x[i] = rd(), v[i] = rd(), p[i] = rd() * percent % P;
  for (off = 1; off <= n; off *= 2)
    ;
  for (int i = 0; i < n; ++i) zkw[off + i] = {dif(1, p[i]), dif(1, p[i]), p[i]};
  for (int i = n; i < off; ++i) zkw[off + i] = E;
  for (int i = off; --i;) zkw[i] = zkw[i * 2] + zkw[i * 2 + 1];
  for (int i = 1; i < n; ++i) {
    unsigned gap = x[i] - x[i - 1];
    e.push_back({gap, unsigned(v[i - 1] + v[i]), i, true});
    if (v[i - 1] < v[i])
      e.push_back({gap, unsigned(v[i] - v[i - 1]), i, false});
    if (v[i - 1] > v[i])
      e.push_back({gap, unsigned(v[i - 1] - v[i]), i, false});
  }
  for (int i = 0; i < n; ++i) l[i] = i, r[i] = i + 1, id[i] = i;
  std::sort(e.begin(), e.end());
  for (auto ev : e) {
    unsigned cur = ev.num * power(ev.den, P - 2) % P;
    int p = ev.pos;
    ans = (ans + (unsigned long long)dif(cur, last) * prob) % P;
    last = cur;
    if (ev.face) {
      int i = id[p - 1], j = id[p];
      prob = prob * power(query(l[i], r[i]), P - 2) % P *
             power(query(l[j], r[j]), P - 2) % P;
      if (r[i] - l[i] < r[j] - l[j]) std::swap(i, j);
      l[i] = std::min(l[i], l[j]);
      r[i] = std::max(r[i], r[j]);
      prob = (unsigned long long)prob * query(l[i], r[i]) % P;
      for (int k = l[j]; k < r[j]; ++k) id[k] = i;
    } else if (v[p - 1] < v[p]) {
      int i = id[p];
      prob = prob * power(query(l[i], r[i]), P - 2) % P;
      p += off;
      zkw[p].lp = zkw[p].sum = 0;
      while (p /= 2) zkw[p] = zkw[p * 2] + zkw[p * 2 + 1];
      prob = (unsigned long long)prob * query(l[i], r[i]) % P;
    } else {
      int i = id[--p];
      prob = prob * power(query(l[i], r[i]), P - 2) % P;
      p += off;
      zkw[p].rp = 0;
      while (p /= 2) zkw[p] = zkw[p * 2] + zkw[p * 2 + 1];
      prob = (unsigned long long)prob * query(l[i], r[i]) % P;
    }
    if (prob == 0) break;
  }
  ans = (ans + (unsigned long long)(P - prob) * last) % P;
  printf("%u\n", ans);
  return 0;
}