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: d = input().split()
  N = int(d[0])
  Q = int(d[1])
  S = "1" * N
  for i in range(Q):
      n = input().split()
      L = int(n[0])
      R = int(n[1])
      D = n[2]
      S = S[: L - 1] + D * (R - L + 1) + S[R - 1 :]
  S = int(S)
  print(S % 998244353)
  
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."}]