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 int N = 100010;
const int mod = 998244353;
inline int Pow(int x, int y) {
  int res = 1;
  for (; y; y >>= 1, x = (long long)x * x % mod)
    if (y & 1) res = (long long)res * x % mod;
  return res;
}
struct Matrix {
  int A[2][2];
  Matrix() { memset(A, 0, sizeof(A)); }
  int *operator[](int a) { return A[a]; }
  Matrix operator*(Matrix &b) {
    Matrix res;
    for (int i = 0; i < 2; i++)
      for (int k = 0; k < 2; k++)
        for (int j = 0; j < 2; j++)
          res[i][j] = (res[i][j] + (long long)A[i][k] * b[k][j]) % mod;
    return res;
  }
} base[N];
struct Node {
  int l, r;
  Matrix res;
} T[N << 2];
inline void pushup(int rt) { T[rt].res = T[rt << 1].res * T[rt << 1 | 1].res; }
void build(int rt, int l, int r) {
  T[rt].l = l, T[rt].r = r;
  int mid = (l + r) >> 1;
  if (l == r) return T[rt].res = base[l], void();
  build(rt << 1, l, mid), build(rt << 1 | 1, mid + 1, r), pushup(rt);
}
void update(int rt, int pos) {
  int l = T[rt].l, r = T[rt].r, mid = (l + r) >> 1;
  if (l == r) return T[rt].res = base[l], void();
  if (pos <= mid)
    update(rt << 1, pos);
  else
    update(rt << 1 | 1, pos);
  pushup(rt);
}
int x[N], v[N], p[N];
struct Inter {
  double x;
  int pos, X, Y, v;
  bool operator<(const Inter &b) const { return x < b.x; }
};
vector<Inter> inter;
inline void apply(int cur) {
  Inter nw = inter[cur];
  base[nw.pos][nw.X][nw.Y] = 0;
  update(1, nw.pos);
}
int main() {
  int n, inv = Pow(100, mod - 2);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d%d%d", &x[i], &v[i], &p[i]), p[i] = (long long)p[i] * inv % mod;
  x[0] = x[1] - 1, v[0] = 1e6 + 1, p[0] = 0;
  for (int i = 1; i <= n; i++) {
    int A = v[i] + v[i - 1], B = abs(v[i] - v[i - 1]);
    A = Pow(A, mod - 2), B = Pow(B, mod - 2);
    A = (long long)A * (x[i] - x[i - 1]) % mod,
    B = (long long)B * (x[i] - x[i - 1]) % mod;
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++) base[i][j][k] = k ? p[i] : mod + 1 - p[i];
    inter.push_back(
        (Inter){(x[i] - x[i - 1]) / (double)(v[i] + v[i - 1]), i, 1, 0, A});
    if (v[i - 1] < v[i])
      inter.push_back(
          (Inter){(x[i] - x[i - 1]) / (double)(v[i] - v[i - 1]), i, 0, 0, B});
    if (v[i - 1] > v[i])
      inter.push_back(
          (Inter){(x[i] - x[i - 1]) / (double)(v[i - 1] - v[i]), i, 1, 1, B});
  }
  build(1, 1, n);
  sort(inter.begin(), inter.end());
  int res = 0;
  for (int i = 0; i < inter.size(); i++) {
    int ls = (T[1].res[0][0] + T[1].res[0][1]) % mod;
    apply(i);
    int j = i;
    while (j + 1 < inter.size() && inter[j + 1].v == inter[i].v)
      apply(j + 1), j++;
    int tmp = (T[1].res[0][0] + T[1].res[0][1]) % mod;
    res = (res + (long long)inter[i].v * (ls - tmp + mod)) % mod, i = j;
  }
  printf("%d\n", res);
  return 0;
}