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 ll = long long;
const int MN = 1e5 + 100;
const int MV = 2e6 + 100;
const int MOD = 998244353;
const ll INF = 2.5e17;
struct intm {
 public:
  int v;
  operator int() const { return v; }
  intm(int v = 0) : v(v) {}
  intm operator+(intm o) const {
    return v + o.v < MOD ? v + o.v : v + o.v - MOD;
  }
  intm operator-(intm o) const { return v < o.v ? v - o.v + MOD : v - o.v; }
  intm operator*(intm o) const {
    return static_cast<int>(static_cast<ll>(v) * o.v % MOD);
  }
};
int gcd(int a, int b) { return a ? gcd(b % a, a) : b; }
intm inv[MV];
struct frac {
 public:
  int n, d;
  frac(int n = 0, int d = 1) : n(n), d(d) {
    int g = gcd(n, d);
    frac::n /= g;
    frac::d /= g;
  }
  bool operator<(frac o) const {
    return static_cast<ll>(n) * o.d < static_cast<ll>(d) * o.n;
  }
  intm get_value() { return intm(n) * inv[d]; }
};
ll pow(ll b, int p) {
  ll r = 1LL;
  for (; p; p >>= 1, b = b * b % MOD)
    if (p & 1) r = r * b % MOD;
  return r;
}
void pcpmod() {
  inv[1] = intm(1);
  for (int i = 2; i < MV; ++i) inv[i] = inv[MOD % i] * intm(MOD - MOD / i);
}
int N;
int x[MN], v[MN], p[MN];
struct St {
 public:
  frac t;
  intm p;
};
std::vector<St> a[1 << 18][4];
void join(std::vector<St>* a, std::vector<St>* b, std::vector<St>* c) {
  int A = a->size(), B = b->size(), i = 0, j = 0;
  c->clear();
  for (; i < A && j < B;)
    if (a->at(i).t < b->at(j).t)
      c->push_back({a->at(i).t, a->at(i).p * b->at(j).p}), ++i;
    else if (b->at(j).t < a->at(i).t)
      c->push_back({b->at(j).t, a->at(i).p * b->at(j).p}), ++j;
    else
      c->push_back({a->at(i).t, a->at(i).p * b->at(j).p}), ++i, ++j;
}
void comb(std::vector<St>* a, std::vector<St>* b, std::vector<St>* c, intm pa) {
  int A = a->size(), B = b->size(), i = 0, j = 0;
  intm pb = intm(1) - pa;
  c->clear();
  for (; i < A && j < B;)
    if (a->at(i).t < b->at(j).t)
      c->push_back({a->at(i).t, a->at(i).p * pa + b->at(j).p * pb}), ++i;
    else if (b->at(j).t < a->at(i).t)
      c->push_back({b->at(j).t, a->at(i).p * pa + b->at(j).p * pb}), ++j;
    else
      c->push_back({a->at(i).t, a->at(i).p * pa + b->at(j).p * pb}), ++i, ++j;
}
std::vector<St> temp[2];
void dq(int n, int l, int r) {
  if (r - l > 1) {
    int m = l + (r - l) / 2;
    dq(n << 1, l, m);
    dq(n << 1 | 1, m, r);
    for (int i = 0; i < 2; ++i)
      for (int j = 0; j < 2; ++j) {
        join(a[n << 1] + i, a[n << 1 | 1] + j * 2, temp);
        join(a[n << 1] + (2 | i), a[n << 1 | 1] + (j << 1 | 1), temp + 1);
        comb(temp, temp + 1, a[n] + (i + j * 2), inv[100] * intm(p[m]));
      }
  } else {
    if (v[l] > v[r])
      a[n][0].push_back({frac(x[r] - x[l], v[l] - v[r]), intm(1)});
    a[n][2].push_back({frac(x[r] - x[l], v[l] + v[r]), intm(1)});
    if (v[l] < v[r])
      a[n][3].push_back({frac(x[r] - x[l], v[r] - v[l]), intm(1)});
    for (int i = 0; i < 4; ++i)
      a[n][i].push_back({frac(1, 0), intm(a[n][i].empty())});
  }
}
intm get(std::vector<St>* a) {
  intm r;
  for (int i = 0; i + 1 < a->size(); ++i)
    r = r + a->at(i).t.get_value() * (a->at(i).p - a->at(i + 1).p);
  return r;
}
intm f;
int main(void) {
  pcpmod();
  scanf("%d", &N);
  if (N == 1) return printf("0\n"), 0;
  for (int i = 0; i < N; ++i) scanf("%d%d%d", x + i, v + i, p + i);
  dq(1, 0, N - 1);
  f = f + intm(p[0] * p[N - 1]) * inv[10000] * get(a[1]);
  f = f + intm((100 - p[0]) * p[N - 1]) * inv[10000] * get(a[1] + 1);
  f = f + intm(p[0] * (100 - p[N - 1])) * inv[10000] * get(a[1] + 2);
  f = f + intm((100 - p[0]) * (100 - p[N - 1])) * inv[10000] * get(a[1] + 3);
  printf("%d\n", static_cast<int>(f));
  return 0;
}