output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      h_1
      :
      h_{2N}
attempt: mod = 998244353
  n, q = map(int, input().split())
  lrd = [list(map(int, input().split())) for _ in range(q)]
  s = 0
  ss = []
  tmp = 1
  for i in range(n):
      ss.append(tmp)
      s += tmp
      s %= mod
      tmp *= 10
      tmp %= mod
  ss.reverse()
  # print(ss,s)
  for l, r, d in lrd:
      for i in range(l - 1, r):
          s -= ss[i]
          ss[i] = d * pow(10, n - i - 1, mod)
          s += ss[i]
          s %= mod
      print(s)
  
problem_description: Statement
  
  There are 2N people numbered 1 through 2N. The height of Person i is h_i.
  
  How many ways are there to make N pairs of people such that the following
  conditions are satisfied? Compute the answer modulo 998,244,353.
  
    * Each person is contained in exactly one pair.
    * For each pair, the heights of the two people in the pair are different.
  
  Two ways are considered different if for some p and q, Person p and Person q
  are paired in one way and not in the other.
samples: [{"input": "2\n    1\n    1\n    2\n    3", "output": "2\n    \n\nThere are two ways:\n\n  * Form the pair (Person 1, Person 3) and the pair (Person 2, Person 4).\n  * Form the pair (Person 1, Person 4) and the pair (Person 2, Person 3).\n\n* * *"}, {"input": "5\n    30\n    10\n    20\n    40\n    20\n    10\n    10\n    30\n    50\n    60", "output": "516"}]