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;
int test = 0;
const int MAXN = 100009;
const long long MOD = 119 << 23 | 1;
class {
 public:
  pair<pair<int, int>, int> poi[MAXN];
  void solve() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
      cin >> poi[i].first.first >> poi[i].first.second >> poi[i].second;
    }
    sort(poi + 1, poi + 1 + n);
    inv100 = inv(100);
    inv2 = inv(2);
    build(1, 1, n);
    vector<pair<double, pair<pair<int, int>, pair<int, int>>>> tim;
    for (int i = 2; i <= n; ++i) {
      long long dist = poi[i].first.first - poi[i - 1].first.first;
      int v = poi[i].first.second + poi[i - 1].first.second;
      double dtim = 1.0 * dist / v;
      pair<double, pair<pair<int, int>, pair<int, int>>> tmp;
      tmp.first = dtim;
      tmp.second.first = {1, 0};
      tmp.second.second = {i, dist * inv(v) % MOD};
      tim.push_back(tmp);
      if (poi[i].first.second > poi[i - 1].first.second) {
        v = poi[i].first.second - poi[i - 1].first.second;
        dtim = 1.0 * dist / v;
        tmp.first = dtim;
        tmp.second.first = {0, 0};
        tmp.second.second = {i, dist * inv(v) % MOD};
        tim.push_back(tmp);
      } else if (poi[i].first.second < poi[i - 1].first.second) {
        v = -poi[i].first.second + poi[i - 1].first.second;
        dtim = 1.0 * dist / v;
        tmp.first = dtim;
        tmp.second.first = {1, 1};
        tmp.second.second = {i, dist * inv(v) % MOD};
        tim.push_back(tmp);
      }
    }
    sort(tim.begin(), tim.end());
    long long ans = 0;
    for (auto it : tim) {
      for (int i = 0; i < 2; ++i)
        for (int j = 0; j < 2; ++j) UPM[i][j] = 0;
      UPM[it.second.first.first][it.second.first.second] = 1;
      update(1, 1, n, it.second.second.first);
      ans =
          (ans +
           (inv2 * it.second.second.second % MOD *
            (Pro[1][0][0] + Pro[1][0][1] + Pro[1][1][0] + Pro[1][1][1]) % MOD) %
               MOD) %
          MOD;
      for (int i = 0; i < 2; ++i)
        for (int j = 0; j < 2; ++j) {
          UPM[i][j] ^= 1;
          Pro[savert][i][j] = save[i][j];
        }
      update(1, 1, n, it.second.second.first);
    }
    cout << ans << '\n';
  }
  void debug(int rt) {
    long long P = 0;
    for (int i = 0; i < 2; ++i) {
      for (int j = 0; j < 2; ++j) {
        P = (P + inv2 * Pro[rt][i][j] % MOD) % MOD;
      }
    }
    cout << P << endl;
  }
  long long UPM[2][2], save[2][2], savert;
  long long inv100, inv2;
  long long inv(long long a, long long b = MOD - 2) {
    long long res = 1;
    while (b) {
      if (b & 1) res = res * a % MOD;
      a = a * a % MOD;
      b >>= 1;
    }
    return res;
  }
  long long Pro[MAXN << 2][2][2];
  void mul(int A, int B, int C) {
    Pro[C][0][0] = (Pro[A][0][0] * Pro[B][0][0] % MOD +
                    Pro[A][0][1] * Pro[B][1][0] % MOD) %
                   MOD;
    Pro[C][0][1] = (Pro[A][0][0] * Pro[B][0][1] % MOD +
                    Pro[A][0][1] * Pro[B][1][1] % MOD) %
                   MOD;
    Pro[C][1][0] = (Pro[A][1][0] * Pro[B][0][0] % MOD +
                    Pro[A][1][1] * Pro[B][1][0] % MOD) %
                   MOD;
    Pro[C][1][1] = (Pro[A][1][1] * Pro[B][1][1] % MOD +
                    Pro[A][1][0] * Pro[B][0][1] % MOD) %
                   MOD;
  }
  void build(int rt, int l, int r) {
    if (l == r) {
      Pro[rt][0][0] = Pro[rt][1][0] = (100ll - poi[l].second) * inv100 % MOD;
      Pro[rt][0][1] = Pro[rt][1][1] = inv100 * poi[l].second % MOD;
      return;
    }
    int mid = l + r >> 1;
    build(rt << 1, l, mid);
    build(rt << 1 | 1, mid + 1, r);
    mul(rt << 1, rt << 1 | 1, rt);
  }
  void update(int rt, int l, int r, int p) {
    if (l == r) {
      for (int i = 0; i < 2; ++i)
        for (int j = 0; j < 2; ++j) save[i][j] = Pro[rt][i][j];
      savert = rt;
      for (int i = 0; i < 2; ++i)
        for (int j = 0; j < 2; ++j) Pro[rt][i][j] *= UPM[i][j];
      return;
    }
    int mid = l + r >> 1;
    if (p <= mid) {
      update(rt << 1, l, mid, p);
    } else {
      update(rt << 1 | 1, mid + 1, r, p);
    }
    mul(rt << 1, rt << 1 | 1, rt);
  }
} NSPACE;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  NSPACE.solve();
}