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 long long mod = 998244353;
template <typename T>
inline void Add(T &x, T y) {
  x += y;
  if (x >= mod) x -= mod;
}
template <typename T>
inline void Mul(T &x, T y) {
  (x *= y) %= mod;
}
inline long long Pow(long long x, int y) {
  long long ans = 1;
  for (; y; y >>= 1, x = x * x % mod)
    if (y & 1) ans = ans * x % mod;
  return ans;
}
inline int read() {
  int x = 0;
  char ch = getchar();
  bool f = 0;
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = 1;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    x = (x << 3) + (x << 1) + (ch ^ 48);
  return f ? -x : x;
}
long long p[100010][2];
long long a[100010 << 2][2][2];
bool bo[100010][2][2];
void build(int u, int l, int r) {
  if (l == r) {
    a[u][0][0] = p[l][0];
    a[u][1][1] = p[r][1];
    return;
  }
  int mid = l + r >> 1;
  build((u << 1), l, mid);
  build((u << 1 | 1), mid + 1, r);
  for (int i = (0), end_i = (1); i <= end_i; i++)
    for (int j = (0), end_i = (1); j <= end_i; j++) {
      a[u][i][j] = 0;
      for (int x = (0), end_i = (1); x <= end_i; x++)
        for (int y = (0), end_i = (1); y <= end_i; y++)
          Add(a[u][i][j], a[(u << 1)][i][x] * a[(u << 1 | 1)][y][j] % mod);
    }
}
void update(int u, int l, int r, int x, int p0, int p1) {
  if (l == r) {
    a[u][0][0] = p0 * p[l][0];
    a[u][1][1] = p1 * p[l][1];
    return;
  }
  int mid = l + r >> 1;
  if (x <= mid)
    update((u << 1), l, mid, x, p0, p1);
  else
    update((u << 1 | 1), mid + 1, r, x, p0, p1);
  for (int i = (0), end_i = (1); i <= end_i; i++)
    for (int j = (0), end_i = (1); j <= end_i; j++) a[u][i][j] = 0;
  for (int i = (0), end_i = (1); i <= end_i; i++)
    for (int j = (0), end_i = (1); j <= end_i; j++)
      if (bo[mid][i][j])
        for (int x = (0), end_i = (1); x <= end_i; x++)
          for (int y = (0), end_i = (1); y <= end_i; y++)
            Add(a[u][x][y], a[(u << 1)][x][i] * a[(u << 1 | 1)][j][y] % mod);
}
int m;
struct node {
  double w;
  int i, l, r;
  long long t;
  friend inline bool operator<(const node &A, const node &B) {
    return A.w < B.w;
  }
};
node q[100010 * 3];
inline void add(int i, int l, int r, int x, int v) {
  q[++m] = (node){(double)x / v, i, l, r, x * Pow(v, mod - 2) % mod};
}
int n, x[100010], v[100010];
int main() {
  long long inv = Pow(100, mod - 2);
  n = read();
  for (int i = (1), end_i = (n); i <= end_i; i++)
    x[i] = read(), v[i] = read(), p[i][1] = read() * inv % mod,
    p[i][0] = mod + 1 - p[i][1];
  for (int i = (1), end_i = (n - 1); i <= end_i; i++) {
    add(i, 1, 0, x[i + 1] - x[i], v[i + 1] + v[i]);
    if (v[i] > v[i + 1]) add(i, 1, 1, x[i + 1] - x[i], v[i] - v[i + 1]);
    if (v[i] < v[i + 1]) add(i, 0, 0, x[i + 1] - x[i], v[i + 1] - v[i]);
  }
  sort(q + 1, q + m + 1);
  for (int i = (1), end_i = (n); i <= end_i; i++)
    for (int j = (0), end_i = (1); j <= end_i; j++)
      for (int k = (0), end_i = (1); k <= end_i; k++) bo[i][j][k] = 1;
  build(1, 1, n);
  int i, l, r;
  long long ans = 0;
  for (int k = (1), end_i = (m); k <= end_i; k++) {
    i = q[k].i;
    l = q[k].l, r = q[k].r;
    update(1, 1, n, i, 1 - l, l);
    update(1, 1, n, i + 1, 1 - r, r);
    for (int x = (0), end_i = (1); x <= end_i; x++)
      for (int y = (0), end_i = (1); y <= end_i; y++)
        Add(ans, a[1][x][y] * q[k].t % mod);
    bo[i][l][r] = 0;
    update(1, 1, n, i, 1, 1);
    update(1, 1, n, i + 1, 1, 1);
  }
  printf("%lld", ans);
  return 0;
}