#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  int f = 1, sum = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    sum = (sum << 3) + (sum << 1) + ch - '0';
    ch = getchar();
  }
  return f * sum;
}
const int N = 200010, Mod = 998244353, Inv = 828542813;
int n, x[N], p[N], v[N];
struct matrix {
  int a[2][2];
  matrix() { memset(a, 0, sizeof(a)); }
  int *operator[](int x) { return a[x]; }
  matrix operator*(matrix &b) {
    matrix c;
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        for (int k = 0; k < 2; k++)
          c[i][j] = (c[i][j] + 1ll * a[i][k] * b[k][j] % Mod) % Mod;
    return c;
  }
  int qry() { return (a[0][0] + a[0][1]) % Mod; }
} t[N << 2];
void build(int o, int l, int r) {
  if (l == r) {
    t[o][0][0] = t[o][1][0] = (Mod + 1 - p[l]) % Mod;
    t[o][0][1] = t[o][1][1] = p[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(o << 1, l, mid);
  build(o << 1 | 1, mid + 1, r);
  t[o] = t[o << 1] * t[o << 1 | 1];
}
void modify(int o, int l, int r, int pos, int a, int b) {
  if (l == r) {
    t[o][a][b] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    modify(o << 1, l, mid, pos, a, b);
  else
    modify(o << 1 | 1, mid + 1, r, pos, a, b);
  t[o] = t[o << 1] * t[o << 1 | 1];
}
int qpow(int a, int b) {
  int ret = 1;
  while (b) {
    if (b & 1) ret = 1ll * ret * a % Mod;
    b >>= 1;
    a = 1ll * a * a % Mod;
  }
  return ret;
}
struct node {
  int len, spd, a, b, id;
  bool operator<(const node &b) const {
    return 1ll * len * b.spd < 1ll * b.len * spd;
  }
} a[N << 2];
int tot = 0;
int main() {
  n = gi();
  for (int i = 1; i <= n; i++)
    x[i] = gi(), v[i] = gi(), p[i] = 1ll * gi() * Inv % Mod;
  build(1, 1, n);
  for (int i = 1; i < n; i++) {
    a[++tot] = (node){x[i + 1] - x[i], v[i] + v[i + 1], 1, 0, i + 1};
    if (v[i] < v[i + 1])
      a[++tot] = (node){x[i + 1] - x[i], v[i + 1] - v[i], 0, 0, i + 1};
    if (v[i] > v[i + 1])
      a[++tot] = (node){x[i + 1] - x[i], v[i] - v[i + 1], 1, 1, i + 1};
  }
  sort(a + 1, a + tot + 1);
  int ans = 0;
  for (int i = 1; i <= tot; i++) {
    int P = t[1].qry(), P2;
    modify(1, 1, n, a[i].id, a[i].a, a[i].b);
    P2 = t[1].qry();
    ans = (ans + 1ll * a[i].len * qpow(a[i].spd, Mod - 2) % Mod *
                     (P - P2 + Mod) % Mod) %
          Mod;
  }
  printf("%d\n", ans);
  return 0;
}
