output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      h_1
      :
      h_{2N}
attempt: import sys
  
  input = sys.stdin.readline
  sys.setrecursionlimit(1000000)
  
  from collections import defaultdict
  from collections import deque
  
  MOD = 998244353
  
  
  def DD(arg):
      return defaultdict(arg)
  
  
  def inv(n):
      return pow(n, MOD - 2, MOD)
  
  
  kaijo_memo = []
  
  
  def kaijo(n):
      if len(kaijo_memo) > n:
          return kaijo_memo[n]
      if len(kaijo_memo) == 0:
          kaijo_memo.append(1)
      while len(kaijo_memo) <= n:
          kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
      return kaijo_memo[n]
  
  
  gyaku_kaijo_memo = []
  
  
  def gyaku_kaijo(n):
      if len(gyaku_kaijo_memo) > n:
          return gyaku_kaijo_memo[n]
      if len(gyaku_kaijo_memo) == 0:
          gyaku_kaijo_memo.append(1)
      while len(gyaku_kaijo_memo) <= n:
          gyaku_kaijo_memo.append(
              gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo), MOD - 2, MOD) % MOD
          )
      return gyaku_kaijo_memo[n]
  
  
  import numpy as np
  
  
  def fft_convolve(f, g):
      """
      数列 (多項式) f, g の畳み込みの計算．上下 15 bitずつ分けて計算することで，
      30 bit以下の整数，長さ 250000 程度の数列での計算が正確に行える．
      """
      Lf, Lg = f.shape[-1], g.shape[-1]
      Lg = g.shape[-1]
      L = Lf + Lg - 1
      fft_len = 1 << L.bit_length()
      fh, fl = f >> 15, f & (1 << 15) - 1
      gh, gl = g >> 15, g & (1 << 15) - 1
  
      def conv(f, g):
          Ff = np.fft.rfft(f, fft_len)
          Fg = np.fft.rfft(g, fft_len)
          h = np.fft.irfft(Ff * Fg)
          return np.rint(h)[..., :L].astype(np.int64) % MOD
  
      x = conv(fl, gl)
      z = conv(fh, gh)
      y = conv(fl + fh, gl + gh) - x - z
      return (x + (y << 15) + (z << 30)) % MOD
  
  
  N = int(input())
  
  nokori = [1]
  for n in range(1, 2 * N + 10):
      nokori.append((nokori[-1] * (2 * n - 1) * (2 * n) * inv(2) * inv(n)) % MOD)
  
  dic = DD(int)
  for _ in range(N * 2):
      dic[int(input())] += 1
  A = [dic[k] for k in dic]
  
  P = []
  for a in A:
      temp = 1
      count = 0
      P.append([temp])
      while a >= 2:
          temp *= a * (a - 1) // 2
          temp %= MOD
          count += 1
          P[-1].append((temp * gyaku_kaijo(count)) % MOD)
          a -= 2
  
  Q = deque([np.array(p) for p in P])
  exit()
  while len(Q) > 1:
      p = Q.popleft()
      q = Q.popleft()
      Q.append(fft_convolve(p, q))
  Q = list(Q[0])
  
  ans = 0
  M = len(Q)
  
  
  def sign(x):
      if x % 2:
          return -1
      else:
          return 1
  
  
  for i in range(M):
      ans += sign(i) * Q[i] * nokori[N - i]
      ans %= MOD
  
  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"}]