output_description: Print Q lines. In the i-th line print the value of S after the i-th query,
  modulo 998,244,353.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N Q
      L_1 R_1 D_1
      :
      L_Q R_Q D_Q
attempt: import sys
  
  from atcoder.lazysegtree import LazySegTree
  from atcoder.modint import ModContext, Modint
  
  
  def main() -> None:
      with ModContext(998244353):
          n, q = map(int, sys.stdin.readline().split())
          a = [(Modint(1), Modint(10))] * n
  
          def op(x: (Modint, Modint), y: (Modint, Modint)) -> (Modint, Modint):
              return x[0] * y[1] + y[0], x[1] * y[1]
  
          e = Modint(0), Modint(1)
  
          def mapping(f: int, y: (Modint, Modint)) -> (Modint, Modint):
              if f == 0:
                  return y
  
              return (y[1] - Modint(1)) * Modint(9).inv() * Modint(f), y[1]
  
          def composition(f: int, g: int) -> int:
              if f == 0:
                  return g
              return f
  
          id_ = 0
  
          lazy_segtree = LazySegTree(op, e, mapping, composition, id_, a)
          for _ in range(q):
              l, r, d = map(int, input().split())
              l -= 1
              lazy_segtree.apply(l, r, d)
              print(lazy_segtree.all_prod()[0].val())
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  You have a string S of length N. Initially, all characters in S are `1`s.
  
  You will perform queries Q times. In the i-th query, you are given two
  integers L_i, R_i and a character D_i (which is a digit). Then, you must
  replace all characters from the L_i-th to the R_i-th (inclusive) with D_i.
  
  After each query, read the string S as a decimal integer, and print its value
  modulo 998,244,353.
samples: [{"input": "8 5\n    3 6 2\n    1 4 7\n    3 8 3\n    2 2 2\n    4 5 1", "output": "11222211\n    77772211\n    77333333\n    72333333\n    72311333\n    \n\n* * *"}, {"input": "200000 1\n    123 456 7", "output": "641437905\n    \n\nDon't forget to take the modulo."}]