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 = 300010, mod = 998244353;
int n, tot;
int x[N], v[N], p[N];
struct mtrx {
  int f[2][2];
  void clear() { memset(f, 0, sizeof(f)); }
  mtrx operator*(const mtrx a) const {
    mtrx c;
    c.clear();
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        for (int k = 0; k < 2; k++)
          c.f[i][j] = (c.f[i][j] + 1ll * f[i][k] * a.f[k][j]) % mod;
    return c;
  }
} t[N << 1];
void pushup(int k) { t[k] = t[k << 1] * t[k << 1 | 1]; }
void build(int l, int r, int k) {
  if (l == r) {
    t[k].f[0][0] = t[k].f[1][0] = p[l];
    t[k].f[0][1] = t[k].f[1][1] = (mod + 1 - p[l]) % mod;
    return;
  }
  int mid = l + r >> 1;
  build(l, mid, k << 1);
  build(mid + 1, r, k << 1 | 1);
  pushup(k);
}
int qp(int x, int k) {
  int res = 1;
  for (; k; k >>= 1, x = 1ll * x * x % mod)
    if (k & 1) res = 1ll * x * res % mod;
  return res;
}
struct data {
  int id, v, s, x, y;
} d[N << 2];
bool cmp(data a, data b) { return 1ll * b.v * a.s < 1ll * a.v * b.s; }
int getspeed(int k, int x, int y) {
  return (x == 0 ? -1 : 1) * v[k - 1] + (y == 1 ? -1 : 1) * v[k];
}
int ans;
mtrx tmp;
void query(int l, int r, int p, int x, int y, int k, int op) {
  if (l == r) {
    if (!op) {
      tmp = t[k];
      t[k].f[x ^ 1][y] = t[k].f[x ^ 1][y ^ 1] = t[k].f[x][y ^ 1] = 0;
    } else {
      t[k] = tmp;
      t[k].f[x][y] = 0;
    }
    return;
  }
  int mid = l + r >> 1;
  if (p <= mid)
    query(l, mid, p, x, y, k << 1, op);
  else
    query(mid + 1, r, p, x, y, k << 1 | 1, op);
  pushup(k);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d%d%d", &x[i], &v[i], &p[i]),
        p[i] = (mod + 1 - 1ll * p[i] * qp(100, mod - 2) % mod) % mod;
  x[0] = -2e9;
  v[0] = 1e9;
  p[0] = 1;
  if (n == 1) {
    puts("0");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++)
        if (getspeed(i, j, k) > 0)
          d[++tot] = (data){i, getspeed(i, j, k), x[i] - x[i - 1], j, k};
  build(1, n, 1);
  sort(d + 1, d + tot + 1, cmp);
  for (int i = 1; i <= tot; i++) {
    query(1, n, d[i].id, d[i].x, d[i].y, 1, 0);
    ans = (ans + 1ll * (t[1].f[0][0] + t[1].f[0][1]) * d[i].s % mod *
                     qp(d[i].v, mod - 2)) %
          mod;
    query(1, n, d[i].id, d[i].x, d[i].y, 1, 1);
  }
  printf("%d\n", ans);
  return 0;
}