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;
double PI = 3.141592653589793238462643383279;
const double EPS = 1e-9;
const long long MOD = 998244353;
const int inf = 1 << 30;
const long long linf = 1LL << 60;
long long mod_pow(long long x, long long y) {
  long long ret = 1;
  while (y) {
    if (y & 1) ret = ret * x % MOD;
    x = x * x % MOD;
    y /= 2;
  }
  return ret;
}
inline long long madd(long long x, long long y) {
  long long ret = x + y;
  if (ret >= MOD) ret -= MOD;
  return ret;
}
struct MAT {
  vector<vector<long long>> x;
  MAT() {
    x.resize(2);
    for (int i = 0; i < (int)2; i++) x[i].resize(2);
    x[0][0] = 1;
    x[0][1] = 0;
    x[1][0] = 0;
    x[1][1] = 1;
  }
  MAT operator+(const MAT& r) const {
    MAT tmp = *this;
    for (int i = 0; i < (int)2; i++)
      for (int j = 0; j < (int)2; j++)
        tmp.x[i][j] = madd(tmp.x[i][j], r.x[i][j]);
    return tmp;
  }
  MAT operator*(const MAT& r) const {
    MAT tmp;
    tmp.x[0][0] = (x[0][0] * r.x[0][0] + x[0][1] * r.x[1][0]) % MOD;
    tmp.x[0][1] = (x[0][0] * r.x[0][1] + x[0][1] * r.x[1][1]) % MOD;
    tmp.x[1][0] = (x[1][0] * r.x[0][0] + x[1][1] * r.x[1][0]) % MOD;
    tmp.x[1][1] = (x[1][0] * r.x[0][1] + x[1][1] * r.x[1][1]) % MOD;
    return tmp;
  }
};
struct segtree {
  int n;
  vector<MAT> dat;
  void init(int n_) {
    n = 1;
    while (n < n_) n *= 2;
    dat.assign(2 * n - 1, MAT());
  }
  void update(int k, MAT& a) {
    k += n - 1;
    dat[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      dat[k].x[0][0] = (dat[k * 2 + 1].x[0][0] * dat[k * 2 + 2].x[0][0] +
                        dat[k * 2 + 1].x[0][1] * dat[k * 2 + 2].x[1][0]) %
                       MOD;
      dat[k].x[0][1] = (dat[k * 2 + 1].x[0][0] * dat[k * 2 + 2].x[0][1] +
                        dat[k * 2 + 1].x[0][1] * dat[k * 2 + 2].x[1][1]) %
                       MOD;
      dat[k].x[1][0] = (dat[k * 2 + 1].x[1][0] * dat[k * 2 + 2].x[0][0] +
                        dat[k * 2 + 1].x[1][1] * dat[k * 2 + 2].x[1][0]) %
                       MOD;
      dat[k].x[1][1] = (dat[k * 2 + 1].x[1][0] * dat[k * 2 + 2].x[0][1] +
                        dat[k * 2 + 1].x[1][1] * dat[k * 2 + 2].x[1][1]) %
                       MOD;
    }
  }
} seg;
struct RAT {
  long long x, v;
  RAT(long long _x, long long _v) : x(_x), v(_v) {}
  long long get() { return x * mod_pow(v, MOD - 2) % MOD; }
};
struct HUGA {
  RAT t;
  int i, a, b;
  HUGA(RAT _t, int _i, int _a, int _b) : t(_t), i(_i), a(_a), b(_b) {}
  bool operator<(const HUGA& r) const { return t.x * r.t.v < t.v * r.t.x; }
};
struct HOGE {
  long long x, v, p;
};
int n;
HOGE hoge[100000];
vector<HUGA> huga;
int main() {
  scanf("%d", &n);
  long long r100 = mod_pow(100, MOD - 2);
  for (int i = 0; i < (int)n; i++) {
    scanf("%lld%lld%lld", &hoge[i].x, &hoge[i].v, &hoge[i].p);
  }
  for (int i = 1; i < n; i++) {
    for (int a = 0; a < (int)2; a++)
      for (int b = 0; b < (int)2; b++) {
        long long d = hoge[i].x - hoge[i - 1].x;
        long long v =
            (a == 0 ? 1 : -1) * hoge[i - 1].v + (b == 1 ? 1 : -1) * hoge[i].v;
        if (v > 0) {
          huga.push_back(HUGA(RAT(d, v), i, a, b));
        }
      }
  }
  sort(huga.begin(), huga.end());
  seg.init(n);
  for (int i = 0; i < n; i++) {
    MAT now;
    for (int a = 0; a < (int)2; a++)
      for (int b = 0; b < (int)2; b++) {
        long long p = (b == 0 ? hoge[i].p : (100 - hoge[i].p));
        p = p * r100 % MOD;
        now.x[a][b] = p;
      }
    seg.update(i, now);
  }
  long long ans = 0;
  for (int _ = 0; _ < (int)huga.size(); _++) {
    MAT now;
    int i = huga[_].i;
    int a = huga[_].a, b = huga[_].b;
    now = seg.dat[i + seg.n - 1];
    MAT nxt = now;
    for (int u = 0; u < (int)2; u++)
      for (int v = 0; v < (int)2; v++) {
        if (u == a && v == b) continue;
        nxt.x[u][v] = 0;
      }
    seg.update(i, nxt);
    ans = (ans + huga[_].t.get() * (seg.dat[0].x[0][0] + seg.dat[0].x[0][1])) %
          MOD;
    now.x[a][b] = 0;
    seg.update(i, now);
  }
  printf("%lld\n", ans);
}