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: # N: 処理する区間の長さ
  mod = 998244353
  N, q = map(int, input().split())
  lrd = [list(map(int, input().split())) for _ in range(q)]
  
  INF = float("inf")  # 2**31-1
  LV = (N - 1).bit_length()
  N0 = 2**LV
  data = [0] * (2 * N0)
  lazy = [0] * (2 * N0)
  
  
  # 伝搬対象の区間を求める
  def gindex(l, r):
      L = (l + N0) >> 1
      R = (r + N0) >> 1
      lc = 0 if l & 1 else (L & -L).bit_length()
      rc = 0 if r & 1 else (R & -R).bit_length()
      for i in range(LV):
          if rc <= i:
              yield R
          if L < R and lc <= i:
              yield L
          L >>= 1
          R >>= 1
  
  
  # 遅延伝搬処理
  def propagates(*ids):
      for i in reversed(ids):
          v = lazy[i - 1]
          if v is None:
              continue
          lazy[2 * i - 1] = data[2 * i - 1] = lazy[2 * i] = data[2 * i] = v
          lazy[i - 1] = None
  
  
  # 区間[l, r)をxで更新
  def update(l, r, x):
      (*ids,) = gindex(l, r)
      propagates(*ids)
      L = N0 + l
      R = N0 + r
      while L < R:
          if R & 1:
              R -= 1
              lazy[R - 1] = data[R - 1] = x * pow(10, N - R % N, mod)
          if L & 1:
              lazy[L - 1] = data[L - 1] = x * pow(10, N - L % N, mod)
              L += 1
          L >>= 1
          R >>= 1
      for i in ids:
          data[i - 1] = data[2 * i - 1] + data[2 * i]
  
  
  # 区間[l, r)内の最小値を求める
  def query(l, r):
      propagates(*gindex(l, r))
      L = N0 + l
      R = N0 + r
      s = 0
      while L < R:
          if R & 1:
              R -= 1
              s = s + data[R - 1]
          if L & 1:
              s = s + data[L - 1]
              L += 1
          L >>= 1
          R >>= 1
      return s
  
  
  s = 0
  ss = []
  tmp = 1
  for i in range(N):
      ss.append(tmp)
      s += tmp
      s %= mod
      tmp *= 10
      tmp %= mod
  ss.reverse()
  update(0, N, 1)
  # print(query(0,N))
  for l, r, d in lrd:
      update(l - 1, r, d)
      print(query(0, N))
  
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."}]