#include <bits/stdc++.h>
using namespace std;
const char lf = '\n';
template <typename T1, typename T2>
inline T1 max(T1 a, T2 b) {
  return a < b ? b : a;
}
template <typename T1, typename T2>
inline T1 min(T1 a, T2 b) {
  return a < b ? a : b;
}
namespace ae86 {
const int bufl = 1 << 15;
char buf[bufl], *s = buf, *t = buf;
inline int fetch() {
  if (s == t) {
    t = (s = buf) + fread(buf, 1, bufl, stdin);
    if (s == t) return EOF;
  }
  return *s++;
}
inline int ty() {
  int a = 0;
  int b = 1, c = fetch();
  while (!isdigit(c)) b ^= c == '-', c = fetch();
  while (isdigit(c)) a = a * 10 + c - 48, c = fetch();
  return b ? a : -a;
}
}  // namespace ae86
using ae86::ty;
const int _ = 200007, mo = 998244353;
template <typename T1, typename T2>
inline T1 ad(T1 &a, T2 b) {
  return a = a + b >= mo ? a + b - mo : a + b;
}
template <typename T1, typename T2>
inline T1 dl(T1 &a, T2 b) {
  return a = a >= b ? a - b : a - b + mo;
}
template <typename T1, typename T2>
inline T1 add(T1 a, T2 b) {
  return a + b >= mo ? a + b - mo : a + b;
}
template <typename T1, typename T2>
inline T1 del(T1 a, T2 b) {
  return a >= b ? a - b : a - b + mo;
}
long long powa(long long a, long long t) {
  long long b = 1;
  while (t) {
    if (t & 1) b = b * a % mo;
    a = a * a % mo, t >>= 1;
  }
  return b;
}
long long inva(long long a) { return powa(a, mo - 2); }
const int M = 2;
struct martix {
  long long val[M][M];
  martix() { memset(val, 0, sizeof(val)); }
  void be1() {
    memset(val, 0, sizeof(val));
    for (int i = 0; i < M; i++) val[i][i] = 1;
  }
  long long *operator[](int x) { return val[x]; }
  friend martix operator*(martix a, martix b) {
    martix c;
    for (int i = 0; i < M; i++)
      for (int j = 0; j < M; j++)
        for (int k = 0; k < M; k++) ad(c[i][j], a[i][k] * b[k][j] % mo);
    return c;
  }
  long long f() { return add(val[0][0], val[0][1]); }
};
int n;
long long loc[_], spd[_], gai[_];
struct sgt {
  static const int _t = _ << 2;
  martix t[_t];
  void up(int x) { t[x] = t[(x << 1)] * t[(x << 1 | 1)]; }
  void plant(int x, int l, int r) {
    if (l == r) {
      t[x][0][0] = t[x][1][0] = del(1, gai[l]);
      t[x][0][1] = t[x][1][1] = gai[l];
      return;
    }
    plant((x << 1), l, ((l + r) >> 1)),
        plant((x << 1 | 1), ((l + r) >> 1) + 1, r), up(x);
  }
  void change(int x, int l, int r, int tar, int a, int b, long long d) {
    if (l == r) {
      t[x][a][b] = d;
      return;
    }
    if (tar <= ((l + r) >> 1))
      change((x << 1), l, ((l + r) >> 1), tar, a, b, d);
    else
      change((x << 1 | 1), ((l + r) >> 1) + 1, r, tar, a, b, d);
    up(x);
  }
} t;
struct cxk {
  int id, av, bv;
  long long dis, spd;
  cxk(int id_ = 0, int av_ = 0, int bv_ = 0, long long dis_ = 0,
      long long spd_ = 0) {
    id = id_, av = av_, bv = bv_, dis = dis_, spd = spd_;
  }
  friend int operator<(cxk a, cxk b) { return a.dis * b.spd < b.dis * a.spd; }
} stk[_ * 3];
int top = 0;
int main() {
  ios::sync_with_stdio(0), cout.tie(nullptr);
  n = ty();
  for (int i = 1, x = inva(100); i <= n; i++)
    loc[i] = ty(), spd[i] = ty(), gai[i] = 1ll * ty() * x % mo;
  t.plant(1, 1, n);
  for (int i = 1; i < n; i++) {
    long long dis = loc[i + 1] - loc[i];
    stk[++top] = cxk(i + 1, 1, 0, dis, spd[i] + spd[i + 1]);
    if (spd[i] > spd[i + 1])
      stk[++top] = cxk(i + 1, 1, 1, dis, spd[i] - spd[i + 1]);
    if (spd[i + 1] > spd[i])
      stk[++top] = cxk(i + 1, 0, 0, dis, spd[i + 1] - spd[i]);
  }
  sort(stk + 1, stk + top + 1);
  long long ans = 0;
  martix temp;
  temp[0][0] = 1;
  for (int i = 1; i <= top; i++) {
    long long dlt = (temp * t.t[1]).f();
    t.change(1, 1, n, stk[i].id, stk[i].av, stk[i].bv, 0);
    dl(dlt, (temp * t.t[1]).f());
    ad(ans, dlt * stk[i].dis % mo * inva(stk[i].spd) % mo);
  }
  cout << ans << lf;
  return 0;
}
