output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      h_1
      :
      h_{2N}
attempt: from operator import mul
  from functools import reduce
  import math
  
  
  def combinations_count(n, r):
      r = min(r, n - r)
      numer = reduce(mul, range(n, n - r, -1), 1)
      denom = reduce(mul, range(1, r + 1), 1)
      return numer // denom
  
  
  n = int(input())
  dic = {}
  for i in range(2 * n):
      tmp = int(input())
      dic.setdefault(tmp, 0)
      dic[tmp] += 1
  print(dic)
  dic_max = max(dic.values())
  dic_min = min(dic.values())
  print(dic_max, dic_min)
  print(combinations_count(dic_max, dic_min))
  ans = 1
  for vl in dic.values():
      print(dic_max, vl)
      ans *= combinations_count(dic_max, vl) * math.factorial(vl)
  ans = ans // math.factorial(dic_max)
  print(ans)
  
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"}]