#include <bits/stdc++.h>
using namespace std;
const long long maxl = 100005, mod = 998244353;
long long read() {
  long long s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -w;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = (s << 1) + (s << 3) + (ch ^ '0');
    ch = getchar();
  }
  return s * w;
}
long long n, ducati, tmp, pos = 0, ans = 0;
struct node {
  long long x, sp, p, pp;
} a[maxl];
struct node2 {
  long long x, t1, y, t2, tim;
  double tim2;
} b[2 * maxl];
bool cmp(node2 xx, node2 yy) { return xx.tim2 > yy.tim2; }
struct Matrix {
  long long mat[2][2];
} tree[3][4 * maxl], val[3][maxl];
long long quick_power(long long x, long long y) {
  long long res = 1;
  for (; y; y = y >> 1, x = (x * x) % mod)
    if (y & 1) res = (res * x) % mod;
  return res;
}
long long ny(long long k) { return quick_power(k, mod - 2); }
Matrix operator*(const Matrix &x, const Matrix &y) {
  Matrix z;
  for (register long long i = 0; i < 2; ++i) {
    for (register long long j = 0; j < 2; ++j) {
      z.mat[i][j] = 0;
      for (register long long k = 0; k < 2; ++k)
        z.mat[i][j] = (z.mat[i][j] + x.mat[i][k] * y.mat[k][j]) % mod;
    }
  }
  return z;
}
void add(long long A, long long B, long long C, long long D, long long E,
         double F) {
  pos++;
  b[pos].x = A, b[pos].t1 = B, b[pos].y = C, b[pos].t2 = D;
  b[pos].tim = E, b[pos].tim2 = F;
}
void pushup1(long long rt) {
  tree[1][rt] = tree[1][2 * rt] * tree[1][2 * rt + 1];
}
void pushup2(long long rt) {
  tree[2][rt] = tree[2][2 * rt + 1] * tree[2][2 * rt];
}
void build_tree1(long long l, long long r, long long rt) {
  if (l == r) {
    tree[1][rt] = val[1][l];
    return;
  }
  long long mid = (l + r) >> 1;
  build_tree1(l, mid, 2 * rt);
  build_tree1(mid + 1, r, 2 * rt + 1);
  pushup1(rt);
}
void build_tree2(long long l, long long r, long long rt) {
  if (l == r) {
    tree[2][rt] = val[2][l];
    return;
  }
  long long mid = (l + r) >> 1;
  build_tree2(l, mid, 2 * rt);
  build_tree2(mid + 1, r, 2 * rt + 1);
  pushup2(rt);
}
void change1(long long nl, long long l, long long r, long long rt) {
  if (l == r) {
    tree[1][rt] = val[1][l];
    return;
  }
  long long mid = (l + r) >> 1;
  if (nl <= mid)
    change1(nl, l, mid, 2 * rt);
  else
    change1(nl, mid + 1, r, 2 * rt + 1);
  pushup1(rt);
}
void change2(long long nl, long long l, long long r, long long rt) {
  if (l == r) {
    tree[2][rt] = val[2][l];
    return;
  }
  long long mid = (l + r) >> 1;
  if (nl <= mid)
    change2(nl, l, mid, 2 * rt);
  else
    change2(nl, mid + 1, r, 2 * rt + 1);
  pushup2(rt);
}
Matrix query1(long long nl, long long nr, long long l, long long r,
              long long rt) {
  if (nl <= l && r <= nr) return tree[1][rt];
  long long mid = (l + r) >> 1;
  if (nl <= mid && nr <= mid)
    return query1(nl, nr, l, mid, 2 * rt);
  else if (nl > mid && nr > mid)
    return query1(nl, nr, mid + 1, r, 2 * rt + 1);
  else if (nl <= mid && nr > mid)
    return query1(nl, nr, l, mid, 2 * rt) *
           query1(nl, nr, mid + 1, r, 2 * rt + 1);
}
Matrix query2(long long nl, long long nr, long long l, long long r,
              long long rt) {
  if (nl <= l && r <= nr) return tree[2][rt];
  long long mid = (l + r) >> 1;
  if (nl <= mid && nr <= mid)
    return query2(nl, nr, l, mid, 2 * rt);
  else if (nl > mid && nr > mid)
    return query2(nl, nr, mid + 1, r, 2 * rt + 1);
  else if (nl <= mid && nr > mid)
    return query2(nl, nr, mid + 1, r, 2 * rt + 1) *
           query2(nl, nr, l, mid, 2 * rt);
}
signed main() {
  n = read();
  ducati = ny(100);
  for (long long i = 1; i <= n; i++) {
    a[i].x = read(), a[i].sp = read(), tmp = read();
    a[i].p = ((100 - tmp) * ducati) % mod, a[i].pp = (tmp * ducati) % mod;
  }
  for (long long i = 2; i <= n; i++) {
    val[1][i].mat[0][1] = a[i].pp;
    val[2][i - 1].mat[1][0] = a[i - 1].p;
    long long tim = ((a[i].x - a[i - 1].x) * ny(a[i].sp + a[i - 1].sp)) % mod;
    double tim2 = (1.00 * a[i].x - a[i - 1].x) / (1.00 * a[i].sp + a[i - 1].sp);
    add(i - 1, 1, i, 0, tim, tim2);
    if (a[i].sp > a[i - 1].sp) {
      long long tim = ((a[i].x - a[i - 1].x) * ny(a[i].sp - a[i - 1].sp)) % mod;
      double tim2 =
          (1.00 * a[i].x - a[i - 1].x) / (1.00 * a[i].sp - a[i - 1].sp);
      add(i - 1, 0, i, 0, tim, tim2);
    } else {
      val[1][i].mat[0][0] = a[i].p;
      val[2][i - 1].mat[0][0] = a[i - 1].p;
    }
    if (a[i].sp < a[i - 1].sp) {
      long long tim = ((a[i].x - a[i - 1].x) * ny(a[i - 1].sp - a[i].sp)) % mod;
      double tim2 =
          (1.00 * a[i].x - a[i - 1].x) / (1.00 * a[i - 1].sp - a[i].sp);
      add(i - 1, 1, i, 1, tim, tim2);
    } else {
      val[1][i].mat[1][1] = a[i].pp;
      val[2][i - 1].mat[1][1] = a[i - 1].pp;
    }
  }
  sort(b + 1, b + pos + 1, cmp);
  build_tree1(1, n, 1), build_tree2(1, n, 1);
  for (long long i = 1; i <= pos; i++) {
    long long rt = b[i].x, ans1, ans2, now;
    Matrix pre, suf;
    if (rt > 1) {
      pre = query1(2, rt, 1, n, 1);
      if (b[i].t1 == 0)
        ans1 = (a[1].p * pre.mat[0][0] + a[1].pp * pre.mat[1][0]) % mod;
      else
        ans1 = (a[1].p * pre.mat[0][1] + a[1].pp * pre.mat[1][1]) % mod;
    } else {
      if (b[i].t1 == 0)
        ans1 = a[1].p;
      else
        ans1 = a[1].pp;
    }
    if (rt + 1 < n) {
      suf = query2(rt + 1, n - 1, 1, n, 1);
      if (b[i].t2 == 0)
        ans2 = (a[n].p * suf.mat[0][0] + a[n].pp * suf.mat[1][0]) % mod;
      else
        ans2 = (a[n].p * suf.mat[0][1] + a[n].pp * suf.mat[1][1]) % mod;
    } else {
      if (b[i].t2 == 0)
        ans2 = a[n].p;
      else
        ans2 = a[n].pp;
    }
    now = (ans1 * ans2) % mod;
    now = (now * b[i].tim) % mod;
    ans = (ans + now) % mod;
    if (b[i].t1 == 0 && b[i].t2 == 0) {
      val[1][rt + 1].mat[0][0] = a[rt + 1].p;
      val[2][rt].mat[0][0] = a[rt].p;
    } else if (b[i].t1 == 1 && b[i].t2 == 0) {
      val[1][rt + 1].mat[1][0] = a[rt + 1].p;
      val[2][rt].mat[0][1] = a[rt].pp;
    } else {
      val[1][rt + 1].mat[1][1] = a[rt + 1].pp;
      val[2][rt].mat[1][1] = a[rt].pp;
    }
    change1(rt + 1, 1, n, 1);
    change2(rt, 1, n, 1);
  }
  cout << ans << endl;
  return 0;
}
