You are given an array $a$ of length $2n$. Consider a partition of array $a$ into two subsequences $p$ and $q$ of length $n$ each (each element of array $a$ should be in exactly one subsequence: either in $p$ or in $q$).

Let's sort $p$ in non-decreasing order, and $q$ in non-increasing order, we can denote the sorted versions by $x$ and $y$, respectively. Then the cost of a partition is defined as $f(p, q) = \sum_{i = 1}^n |x_i - y_i|$.

Find the sum of $f(p, q)$ over all correct partitions of array $a$. Since the answer might be too big, print its remainder modulo $998244353$.


-----Input-----

The first line contains a single integer $n$ ($1 \leq n \leq 150\,000$).

The second line contains $2n$ integers $a_1, a_2, \ldots, a_{2n}$ ($1 \leq a_i \leq 10^9$) — elements of array $a$.


-----Output-----

Print one integer — the answer to the problem, modulo $998244353$.


-----Examples-----
Input
1
1 4

Output
6
Input
2
2 1 2 1

Output
12
Input
3
2 2 2 2 2 2

Output
0
Input
5
13 8 35 94 9284 34 54 69 123 846

Output
2588544


-----Note-----

Two partitions of an array are considered different if the sets of indices of elements included in the subsequence $p$ are different.

In the first example, there are two correct partitions of the array $a$:  $p = [1]$, $q = [4]$, then $x = [1]$, $y = [4]$, $f(p, q) = |1 - 4| = 3$;  $p = [4]$, $q = [1]$, then $x = [4]$, $y = [1]$, $f(p, q) = |4 - 1| = 3$. 

In the second example, there are six valid partitions of the array $a$:   $p = [2, 1]$, $q = [2, 1]$ (elements with indices $1$ and $2$ in the original array are selected in the subsequence $p$);  $p = [2, 2]$, $q = [1, 1]$;  $p = [2, 1]$, $q = [1, 2]$ (elements with indices $1$ and $4$ are selected in the subsequence $p$);  $p = [1, 2]$, $q = [2, 1]$;  $p = [1, 1]$, $q = [2, 2]$;  $p = [2, 1]$, $q = [2, 1]$ (elements with indices $3$ and $4$ are selected in the subsequence $p$).

Source: codeforces | Difficulty: HARD
Tags: Sorting

Combinatorics

Mathematics


Solutions:
n = int(input())
l = sorted(map(int, input().split()))
tot = sum(l[n:]) - sum(l[:n])
MOD = 998244353
fact = [1]
for i in range(1, 2 * n + 1):
	fact.append(fact[-1] * i % MOD)
tot *= fact[2 * n]
inv = pow(fact[n], MOD - 3, MOD)
tot *= inv
print(tot % MOD)


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
a.sort()
L = a[:n]
R = a[n:][::-1]
s = sum((x - y for (x, y) in zip(R, L)))
MOD_NUM = 998244353
D = 1
for x in range(1, n + 1):
	D *= x
	D %= MOD_NUM
U = D
for x in range(n + 1, 2 * n + 1):
	U *= x
	U %= MOD_NUM
ans = U * pow(D, MOD_NUM - 2, MOD_NUM) * pow(D, MOD_NUM - 2, MOD_NUM)
print(ans * s % MOD_NUM)


mod = 998244353
n = int(input())
a = list(map(int, input().split()))
a.sort()
res = 0
inv = [1, 1]
for i in range(2, n + 1):
	inv.append((mod - mod // i) * inv[mod % i] % mod)
for i in range(n):
	res += a[n + i] - a[i]
for i in range(2 * n, 0, -1):
	if i > n:
		res = res * i % mod
	else:
		res = res * inv[i] % mod
print(res)


n = int(input())
a = sorted(map(int, input().split()))
mod = 998244353
z = 0
facn = 1
for i in range(n):
	z += abs(a[i] - a[-(i + 1)])
	facn = facn * (i + 1) % mod
fac2n = facn
for i in range(n + 1, 2 * n + 1):
	fac2n = fac2n * i % mod
invfacn = pow(facn, mod - 2, mod)
print(z * fac2n * invfacn * invfacn % mod)


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	n = int(input())
	a = list(map(int, input().split()))
	sa = sorted(a)
	mod = 998244353

	def quickpower(a, n, p):
		ans = 1
		while n:
			if n & 1:
				ans = ans * a % p
			a = a * a % p
			n = n >> 1
		return ans

	def inverse(a, p):
		return quickpower(a, p - 2, p)
	fact = [1] * (2 * n + 1)
	infact = [1] * (2 * n + 1)
	for i in range(1, 2 * n + 1):
		fact[i] = fact[i - 1] * i % mod
		infact[i] = infact[i - 1] * quickpower(i, mod - 2, mod) % mod
	cnt = fact[2 * n] * infact[n] % mod * infact[n] % mod
	ans = cnt * (sum([sa[i] for i in range(n, 2 * n)]) - sum([sa[i] for i in range(n)]))
	print(ans % mod)
main()


from sys import stdin, gettrace
if gettrace():
	inputi = input
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()
MOD = 998244353

def main():
	n = int(inputi())
	aa = [int(a) for a in inputi().split()]
	aa.sort()
	sm = sum(aa[n:]) - sum(aa[:n]) % MOD
	fac = [1]
	for i in range(1, n * 2 + 1):
		fac.append(fac[-1] * i % MOD)
	fni = pow(fac[n], MOD - 2, MOD)
	res = sm * fac[n * 2] * fni * fni % MOD
	print(res)
main()


(N, MOD) = (300005, 998244353)
f = [1] * N
for i in range(1, N):
	f[i] = f[i - 1] * i % MOD
n = int(input())
ar = sorted(list(map(int, input().split())))
e = (-sum(ar[:n]) + sum(ar[-n:])) % MOD
e = e * f[2 * n] % MOD
e = e * pow(f[n], MOD - 2, MOD) % MOD
e = e * pow(f[n], MOD - 2, MOD) % MOD
print(e)


import sys, time
from copy import copy, deepcopy as dcopy
from os import path
from collections import *
from heapq import *
from math import *
mod = 998244353

def mpow(a, b):
	ans = 1
	while b:
		if b & 1:
			ans = ans * a % mod
		a = a * a % mod
		b //= 2
	return ans

def solve(kkkk):
	n = inp()
	arr = ina()
	arr.sort()
	ans = 0
	for i in range(2 * n):
		if i < n:
			ans -= arr[i]
		else:
			ans += arr[i]
	ans %= mod
	ans += mod
	ans %= mod
	fact = [1, 1]
	while len(fact) < 2 * n + 5:
		fact.append(fact[-1] * len(fact) % mod)
	inv = mpow(fact[n], mod - 2)
	inv = inv * inv % mod
	ans *= inv
	ans *= fact[2 * n]
	ans %= mod
	out(ans)

def main():
	t = 1
	for i in range(t):
		solve(i + 1)
localsys = 0
start_time = time.time()
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
	localsys = 1
cin = sys.stdin.readline
cout = sys.stdout.write

def inp():
	return int(cin().strip())

def ins():
	return list(cin().strip())

def inm():
	return map(int, cin().strip().split())

def ina():
	return list(map(int, cin().strip().split()))

def out(a):
	cout(str(a) + '\n')

def outa(a):
	cout(' '.join(map(str, a)) + '\n')

def outm(a, b, c=None, d=None):
	cout(str(a) + ' ' + str(b))
	if c != None:
		cout(' ' + str(c))
	if d != None:
		cout(' ' + str(d))
	cout('\n')
main()
if localsys:
	print('\n\nTime Elapsed :', time.time() - start_time, 'seconds')


mod = 998244353

def pow_(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def reverse(x, mod):
	return pow_(x, mod - 2, mod)
gt = [1] * 300001
for i in range(2, 300001):
	gt[i] = i * gt[i - 1] % mod
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
cof = gt[2 * n] * reverse(gt[n], mod) * reverse(gt[n], mod)
ans = (sum(a[n:]) - sum(a[:n])) * cof % mod
print(ans)


import math
mod = 998244353
n = int(input())
lista = sorted([int(x) for x in input().split()])
factorial = [1] * (2 * n + 1)
rfactorial = [1] * (2 * n + 1)
for i in range(1, 2 * n + 1):
	factorial[i] = i * factorial[i - 1] % mod
	rfactorial[i] = rfactorial[i - 1] * pow(i, mod - 2, mod) % mod

def Combination(n, k):
	if n < k:
		return 0
	return factorial[n] * rfactorial[k] * rfactorial[n - k]
L = 0
R = 0
for i in range(0, n):
	L += lista[i]
	R += lista[i + n]
print(int((R - L) * Combination(2 * n, n) % mod))


def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
n = int(input())
a = sorted(list(map(int, input().split())))
ans = 0
for i in range(n):
	ans += abs(a[i] - a[2 * n - 1 - i]) % 998244353
print(ncr(2 * n, n, 998244353) * ans % 998244353)


import sys
from sys import stdin

def modfac(n, MOD):
	f = 1
	factorials = [1]
	for m in range(1, n + 1):
		f *= m
		f %= MOD
		factorials.append(f)
	inv = pow(f, MOD - 2, MOD)
	invs = [1] * (n + 1)
	invs[n] = inv
	for m in range(n, 1, -1):
		inv *= m
		inv %= MOD
		invs[m - 1] = inv
	return (factorials, invs)

def modnCr(n, r, mod, fac, inv):
	return fac[n] * inv[n - r] * inv[r] % mod
mod = 998244353
n = int(stdin.readline())
a = list(map(int, stdin.readline().split()))
a.sort()
(fac, inv) = modfac(2 * n + 10, mod)
print(modnCr(2 * n, n, mod, fac, inv) * (sum(a[n:]) - sum(a[:n])) % mod)


import sys
readline = sys.stdin.readline
MOD = 998244353

def make_fac(limit):
	fac = [1] * limit
	for i in range(2, limit):
		fac[i] = i * fac[i - 1] % MOD
	faci = [0] * limit
	faci[-1] = pow(fac[-1], MOD - 2, MOD)
	for i in range(limit - 2, 0, -1):
		faci[i] = faci[i + 1] * (i + 1) % MOD
	return (fac, faci)
(fac, faci) = make_fac(341398)

def comb(a, b):
	if not a >= b >= 0:
		return 0
	return fac[a] * faci[b] * faci[a - b] % MOD
N = int(readline())
A = list(map(int, readline().split()))
A.sort()
print((sum(A[N:]) - sum(A[:N])) % MOD * comb(2 * N, N) % MOD)


def pwm(a, n, md):
	p = 1
	while n:
		if n & 1:
			p = p * a % md
		a = a * a % md
		n >>= 1
	return p
n = int(input())
ar = list(map(int, input().split()))
ar.sort()
ans = 0
nom = 1
dnom = 1
mod = 998244353
for i in range(0, n):
	ans = (ans + ar[i + n] - ar[i]) % mod
	nom = nom * (i + n + 1) % mod
	dnom = dnom * (i + 1) % mod
print(ans * nom % mod * pwm(dnom, mod - 2, mod) % mod)


(md, n) = (998244353, int(input()))
arr = sorted(list(map(int, input().split())))
sigma = (sum(arr[n:]) - sum(arr[:n])) % md
(up, dn) = (1, 1)
for i in range(1, n + 1):
	up = up * (n + i) % md
	dn = dn * i % md
print(sigma * up % md * pow(dn, md - 2, md) % md)


import sys, math
from math import factorial as fact
mod = 10 ** 9 + 7
m = 998244353
input = lambda : sys.stdin.readline().strip()
inp = lambda : list(map(int, input().split()))

def binexp(a, n, m):
	res = 1
	while n > 0:
		if n % 2 == 1:
			res = res * a % m
		a = a * a % m
		n = n >> 1
	return res

def C(n, r, m):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % m
		den = den * (i + 1) % m
	res = num * binexp(den, m - 2, m) % m
	return res
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = sum([a[2 * n - 1 - i] - a[i] for i in range(n)])
print(C(2 * n, n, m) * (ans % m) % m)


import os
import sys
from io import BytesIO, IOBase

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		(g, y, x) = egcd(b % a, a)
		return (g, x - b // a * y, y)

def modinv(a, m):
	(g, x, y) = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m

def combination(n, k, MOD):
	ans = 1
	for i in range(n - k + 1, n + 1):
		ans *= i
		ans %= MOD
	for i in range(1, k + 1):
		ans *= modinv(i, MOD)
		ans %= MOD
	return ans

def main():
	n = int(input())
	a = list(map(int, input().split()))
	MOD = 998244353
	a.sort()
	initSum = sum(a[0:n])
	finalSum = sum(a) - initSum
	combi = combination(2 * n, n, MOD)
	print((finalSum - initSum) * combi % MOD)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys, io, os
BUFSIZE = 8192

class FastIO(io.IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = io.BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(io.IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def combination(n, r, mod=10 ** 9 + 7):
	(n1, r) = (n + 1, min(r, n - r))
	numer = denom = 1
	for i in range(1, r + 1):
		numer = numer * (n1 - i) % mod
		denom = denom * i % mod
	return numer * pow(denom, mod - 2, mod) % mod
N = int(input())
A = sorted(map(int, input().split()))
mod = 998244353
c = 0
for (a1, a2) in zip(A[:N], reversed(A)):
	c += a2 - a1
c *= combination(N * 2, N, mod)
c %= mod
print(c)


import sys
import math
import bisect
import heapq
from bisect import bisect_right
from sys import stdin, stdout

def get_ints_in_variables():
	return map(int, sys.stdin.readline().strip().split())

def get_int():
	return int(sys.stdin.readline())

def get_ints_in_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

def get_string():
	return sys.stdin.readline().strip()

def power(a, b, mod):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % mod
		a = a * a % mod
		b = b // 2
	return res

def Solution(arr, n):
	mod = 998244353
	firstSum = 0
	for i in range(n):
		firstSum = (firstSum + arr[i]) % mod
	backSum = 0
	for i in range(2 * n - 1, n - 1, -1):
		backSum = (backSum + arr[i]) % mod
	res = (backSum - firstSum) % mod
	fact = 1
	for i in range(1, n + 1):
		res = res * (n + i) % mod
		fact = fact * i % mod
	res = res * power(fact, mod - 2, mod) % mod
	print((res + mod) % mod)

def main():
	n = get_int()
	arr = sorted(get_ints_in_list())
	Solution(arr, n)
main()


maxn = 5 * 10 ** 5
mo = 998244353
rev = lambda x: pow(x, mo - 2, mo)
fact = [0] * maxn
fact[0] = 1
for i in range(1, maxn):
	fact[i] = fact[i - 1] * i % mo
ract = [0] * maxn
ract[maxn - 1] = rev(fact[maxn - 1])
for i in range(maxn - 2, -1, -1):
	ract[i] = ract[i + 1] * (i + 1) % mo
C = lambda u, v: fact[u] * ract[v] % mo * ract[u - v] % mo
n = int(input())
a = list(map(int, input().split()))
a.sort()
w = sum(a[n:]) - sum(a[:n])
w %= mo
v = C(n * 2, n)
print(w * v % mo)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]

def YES():
	print('YES')

def NO():
	print('NO')

def Yes():
	print('Yes')

def No():
	print('No')
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24
N = 300005
mod = 998244353
fac = [1, 1]
finv = [1, 1]
inv = [0, 1]
for i in range(2, N + 1):
	fac.append(fac[-1] * i % mod)
	inv.append(mod - inv[mod % i] * (mod // i) % mod)
	finv.append(finv[-1] * inv[-1] % mod)

def comb(n, r):
	if n < r:
		return 0
	else:
		return fac[n] * (finv[r] * finv[n - r] % mod) % mod

def solve():
	n = int(inp())
	mod = 998244353
	ar = lis()
	ar.sort()
	s1 = sum(ar)
	s2 = sum(ar[:n])
	t = s1 - 2 * s2
	t %= mod
	t *= comb(2 * n, n)
	t %= mod
	print(t)
solve()


import io
import os
from collections import Counter, defaultdict, deque
MOD = 998244353
MAX_N = 3 * 10 ** 5 + 1

def modInverse(a, p):
	return pow(a, p - 2, p)
fact = [1]
for i in range(1, MAX_N + 1):
	fact.append(fact[-1] * i % MOD)
invFact = [0] * (MAX_N + 1)
invFact[MAX_N] = modInverse(fact[MAX_N], MOD)
for i in range(MAX_N - 1, -1, -1):
	invFact[i] = invFact[i + 1] * (i + 1) % MOD
inv = [0] * (MAX_N + 1)
for i in range(1, MAX_N + 1):
	inv[i] = fact[i - 1] * invFact[i] % MOD

def nCr(n, r):
	if n < r:
		return 0
	return fact[n] * invFact[r] * invFact[n - r] % MOD

def solve1(N, A):
	A.sort()
	score = 0
	for mask in range(2 ** (2 * N)):
		P = []
		Q = []
		for i in range(2 * N):
			if 1 << i & mask:
				P.append(i)
			else:
				Q.append(i)
		if len(P) == len(Q) == N:
			P.sort(key=lambda i: A[i])
			Q.sort(key=lambda i: A[i], reverse=True)
			score += sum((abs(A[i] - A[j]) for (i, j) in zip(P, Q)))
	return score % MOD

def solve(N, A):
	A.sort()
	return nCr(2 * N, N) * (sum(A[N:]) - sum(A[:N])) % MOD
DEBUG = False
if DEBUG:
	import random
	random.seed(0)
	for _ in range(100):
		N = random.randint(1, 10)
		A = [random.randint(1, 10) for i in range(2 * N)]
		print('tc', _, N, A)
		ans1 = solve1(N, A)
		ans = solve(N, A)
		assert ans1 == ans
		print(ans1, ans)
	exit()
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = 1
for tc in range(1, TC + 1):
	(N,) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	ans = solve(N, A)
	print(ans)


import sys
input = sys.stdin.readline
mod = 998244353
n = int(input())
a = list(map(int, input().split()))
a.sort()
val = 0
for i in range(n):
	val += a[-i - 1]
	val -= a[i]
facs = [1]
for i in range(2 * n):
	facs.append(facs[-1] * (i + 1) % mod)
numb = facs[2 * n]
numb *= pow(facs[n] ** 2, mod - 2, mod)
numb *= val
numb %= mod
print(numb)


def ncrmod(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % mod
		den = den * (i + 1) % mod
	return num * pow(den, mod - 2, mod) % mod
n = int(input())
a = list(map(int, input().split()))
mod = 998244353
a = sorted(a)
l1 = a[:n]
l2 = a[n:]
diff = sum([abs(l1[i] - l2[i]) for i in range(n)])
out = ncrmod(2 * n, n) * (diff % mod) % mod
print(out)


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key, lru_cache
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
M = mod = 998244353

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip().split()]

def st():
	return str(input().rstrip())[2:-1]

def val():
	return int(input().rstrip())

def li2():
	return [str(i)[2:-1] for i in input().rstrip().split()]

def li3():
	return [int(i) for i in st()]
M = mod = 998244353
N = 3 * 10 ** 5
facts = [1]
for i in range(1, N + 10):
	facts.append(facts[-1] * i % mod)

def ncr(n, r):
	return facts[n] * inv_mod(facts[n - r]) * inv_mod(facts[r]) % mod
n = val()
l = sorted(li())
su1 = sum(l[n:])
su2 = sum(l[:n])
ans = su1 - su2
print(ans * ncr(2 * n, n) % mod)


def mod_fact(n, m):
	ans = 1
	for i in range(1, n + 1):
		ans = ans % m * (i % m) % m
	return ans

def mod_div(a, b, md):
	a %= md
	b %= md
	return a * pow(b, md - 2, md) % md
MOD = 998244353
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
su = abs(sum(arr[:n]) - sum(arr[n:])) % MOD
combs = mod_div(mod_fact(2 * n, MOD), pow(mod_fact(n, MOD), 2, MOD), MOD)
print(su * combs % MOD)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict as dd, deque as dq
import math, string

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 998244353

def solve():
	N = getInt()
	A = getInts()
	A.sort()
	ans = 0
	for j in range(N):
		ans -= A[j]
	for j in range(N, 2 * N):
		ans += A[j]
	ans %= MOD
	curr = 1
	for j in range(1, 2 * N + 1):
		curr *= j
		curr %= MOD
		if j == N:
			n_fac = curr
		if j == 2 * N:
			tn_fac = curr
	div = pow(n_fac, MOD - 2, MOD)
	return ans * tn_fac * div * div % MOD
print(solve())


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 998244353
mod = 998244353
n = int(input())
a = list(map(int, input().split()))
a.sort()
s = Combination(mod)
r = s.ncr(2 * n, n)
c = 0
for i in range(n):
	c += a[i + n] - a[i]
r *= c
r %= mod
print(r)


m = 998244353
n = int(input())
l = sorted(map(int, input().split()))
N = 2 * n
t = 1
a = (sum(l[n:]) - sum(l[:n])) % m
for i in range(n):
	a = a * (N - i) % m
for i in range(1, n + 1):
	t = t * i % m
print(pow(t, m - 2, m) * a % m)


n = int(input())
mod = 998244353
den = 1
arr = [int(x) for x in input().split()]
arr.sort()
for i in range(1, n + 1):
	den = den * (i + n) * pow(i, mod - 2, mod) % mod
print((sum(arr[n:2 * n]) - sum(arr[0:n])) * den % mod)


import sys
import math, bisect
sys.setrecursionlimit(10 ** 5)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict
I = lambda : int(sys.stdin.readline())
neo = lambda : map(int, sys.stdin.readline().split())
Neo = lambda : list(map(int, sys.stdin.readline().split()))
n = I()
A = Neo()
mod = 998244353
fact = [1]
for i in range(1, 2 * n + 1):
	fact += [fact[-1] * i % mod]
(B, C) = (A[0::2], A[1::2])
B.sort()
C.sort(reverse=True)
Ans = 0
for (i, j) in zip(B, C):
	Ans += abs(i - j)
	Ans = Ans % mod
Ans = Ans * fact[2 * n] * pow(fact[n] * fact[n], mod - 2, mod) % mod
print(Ans)


MOD = 998244353
n = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(2 * n):
	a[i] %= MOD
sum = 0
t = 1
for i in range(n):
	sum += a[i + n] - a[i]
	sum %= MOD
for i in range(1, n + 1):
	sum = sum * (2 * n - i + 1) % MOD
	t = t * i % MOD
print(pow(t, MOD - 2, MOD) * sum % MOD)


MOD = 998244353

def pow_mod(a, n, mod):
	result = 1 % mod
	a_pow_2_pow_bit_index = a % mod
	while n:
		if n & 1:
			result *= a_pow_2_pow_bit_index
			result %= mod
		a_pow_2_pow_bit_index **= 2
		a_pow_2_pow_bit_index %= mod
		n >>= 1
	return result

def inv_mod(x, mod):
	return pow_mod(x, mod - 2, mod)

def factorial_mod(n, mod):
	result = 1 % mod
	for x in range(1, n + 1):
		result *= x
		result %= mod
	return result
n = int(input())
a = sorted(map(int, input().split()))
s = sum((-x for x in a[:n])) + sum((+x for x in a[n:]))
s %= MOD
result = factorial_mod(2 * n, MOD) * inv_mod(factorial_mod(n, MOD) ** 2 % MOD, MOD)
result %= MOD
result *= s
result %= MOD
print(result)


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def ncrmod(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % mod
		den = den * (i + 1) % mod
	return num * pow(den, mod - 2, mod) % mod
n = int(input())
a = list(map(int, input().split()))
mod = 998244353
l1 = sorted(a[:n])
l2 = sorted(a[n:], reverse=True)
diff = sum([abs(l1[i] - l2[i]) for i in range(n)])
out = ncrmod(2 * n, n) * (diff % mod) % mod
print(out)


import sys
import math

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()

def FACT(n, mod):
	s = 1
	facts = [1]
	for i in range(1, n + 1):
		s *= i
		s %= mod
		facts.append(s)
	return facts[n]

def C(n, k, mod):
	return FACT(n, mod) * pow(FACT(k, mod) * FACT(n - k, mod) % mod, mod - 2, mod) % mod
n = II()
a = LI()
x = sorted(a[:n])
y = sorted(a[n:])[:][::-1]
s = 0
mod = 998244353
for i in range(n):
	s += abs(x[i] - y[i])
print(s * C(2 * n, n, mod) % mod)


def bp(b, p):
	if p == 1:
		return b
	if p % 2 == 0:
		t = bp(b, p // 2)
		return t * t % q
	else:
		return bp(b, p - 1) * b % q

def inv(x):
	return bp(x, q - 2)

def div(a, b):
	return a * inv(b) % q
n = int(input())
u = sorted(list(map(int, input().split())))
s = sum(u[n:]) - sum(u[:n])
q = 998244353
ans = 1
for i in range(1, 2 * n + 1):
	ans *= i
	ans %= q
for i in range(1, n + 1):
	ans = div(ans, i)
	ans = div(ans, i)
ans *= s
ans %= q
print(ans)


n = int(input())
a = list(map(int, input().split()))
mod = 998244353

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
a.sort()
print(ncr(2 * n, n, mod) * (sum(a[n:]) - sum(a[0:n])) % mod)


m = 998244353

def modExp(a, n, m=10 ** 9 + 7):
	if n == 0:
		return 1
	elif n == 1:
		return a
	else:
		while n >= 2:
			if n % 2 == 0:
				n = n // 2
				return modExp(a % m * (a % m) % m, n, m)
			else:
				n = (n - 1) // 2
				return a % m * modExp(a % m * (a % m) % m, n, m) % m % m
dic = {0: 1}
for i in range(1, 300001):
	dic[i] = dic[i - 1] * i % m

def nCr(n, r):
	return dic[n] * modExp(dic[r] * dic[n - r] % m, m - 2, m) % m
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
i = 0
out = 0
while i < n:
	out += abs(arr[i] - arr[n + i])
	i += 1
print(out * nCr(2 * n, n) % m)


n = int(input())
s = list(map(int, input().split()))
s = sorted(s)
k = 0
for i in range(n):
	k -= s[i]
	k += s[i + n]
	k = k % 998244353
s = k
m = 1
for i in range(1, n + 1):
	s = s * (2 * n + 1 - i) % 998244353
	m = m * i % 998244353
print(pow(m, 998244353 - 2, 998244353) * s % 998244353)


def choose(n):
	global mod
	num = den = 1
	for i in range(n):
		num = num * (2 * n - i) % mod
		den = den * (i + 1) % mod
	return num * pow(den, mod - 2, mod) % mod
mod = 998244353
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
a = arr[:n]
b = arr[n:]
b.sort(reverse=True)
total = 0
for i in range(n):
	total += abs(b[i] - a[i])
	total = total % 998244353
print(total * choose(n) % 998244353)


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.buffer.readline())

def MI():
	return map(int, sys.stdin.buffer.readline().split())

def LI():
	return list(map(int, sys.stdin.buffer.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def BI():
	return sys.stdin.buffer.readline().rstrip()

def SI():
	return sys.stdin.buffer.readline().rstrip().decode()

def nCr(com_n, com_r):
	if com_n < com_r:
		return 0
	return fac[com_n] * ifac[com_r] % md * ifac[com_n - com_r] % md
md = 998244353
n_max = 300005
fac = [1]
for i in range(1, n_max + 1):
	fac.append(fac[-1] * i % md)
ifac = [1] * (n_max + 1)
ifac[n_max] = pow(fac[n_max], md - 2, md)
for i in range(n_max - 1, 1, -1):
	ifac[i] = ifac[i + 1] * (i + 1) % md
n = II()
aa = LI()
aa.sort()
ans = 0
for i in range(n):
	ans += -aa[i] + aa[2 * n - 1 - i]
	ans %= md
ans *= nCr(2 * n, n)
ans %= md
print(ans)


MOD = 998244353
MAX = 300000
fact = [1]
for zz in range(1, MAX + 1):
	fact.append(fact[-1] % MOD * zz % MOD % MOD)

def nCr(n, r):
	num = fact[n]
	den = fact[r] % MOD * (fact[n - r] % MOD) % MOD
	return num % MOD * pow(den, MOD - 2, MOD) % MOD
n = int(input())
a = [int(x) for x in input().split()]
p = a[:n]
q = a[n:]
p.sort()
q.sort(reverse=True)
oneCombinationSum = 0
for i in range(n):
	oneCombinationSum += abs(p[i] - q[i])
	oneCombinationSum %= MOD
nWays = nCr(2 * n, n)
ans = oneCombinationSum * nWays % MOD
print(ans)


n = int(input())
z = sorted(map(int, input().split()))
mod = 998244353
fact = [1] * (2 * n + 1)
for i in range(1, 2 * n + 1):
	fact[i] = fact[i - 1] * i % mod
inv = [0] * (2 * n + 1)
inv[2 * n] = pow(fact[i], mod - 2, mod)
for i in range(2 * n - 1, -1, -1):
	inv[i] = inv[i + 1] * (i + 1) % mod

def ncr(n, r):
	return fact[n] * inv[n - r] % mod * inv[r] % mod % mod
(a, b) = (0, 0)
for i in range(n):
	a += z[i]
for j in range(n, 2 * n):
	b += z[j]
t = b - a
print(ncr(2 * n, n) * t % mod)


n = int(input())
m = 998244353
a = list(map(int, input().split()))
a.sort()
num = (sum(a[n:]) - sum(a[:n])) % m
den = 1
for i in range(1, n + 1):
	num = num * (2 * n - i + 1) % m
	den = den * pow(i, m - 2, m) % m
print(den * num % m)


(M, n, a, t) = (998244353, int(input()), sorted(list(map(int, input().split()))), 1)
s = (sum(a[n:]) - sum(a[:n])) % M
for i in range(2, n + 1):
	t *= i
	t %= M
tt = pow(t, 2 * M - 4, M)
for i in range(n + 1, 2 * n + 1):
	t *= i
	t %= M
print(tt * t % M * s % M)


def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def solve(n, a):
	a.sort()
	M = 998244353
	ss = sum(a[:n])
	ls = sum(a[n:])
	diff = (ls - ss) % M
	return diff * ncr(2 * n, n, M) % M
n = int(input())
a = list(map(int, input().split()))
print(solve(n, a))


mod = 998244353
n = int(input())
a = [int(x) for x in input().split()]
a.sort()
small = a[:n]
big = a[n:]
s = (sum(big) - sum(small)) % mod
fact = [1]
for i in range(1, 2 * n + 1):
	ans = fact[-1] * i % mod
	fact.append(ans)
ans = fact[2 * n] * pow(fact[n], mod - 2, mod) ** 2 % mod
print(s * ans % mod)


from bisect import *
from collections import *
from random import *
from decimal import *
from itertools import *
from heapq import *
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def st():
	return input().rstrip('\n')

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())
t = 1
p = 998244353
fac = [1]
for i in range(1, 300010):
	fac.append(fac[-1] * i % p)
while t:
	t -= 1
	n = inp()
	a = lis()
	a.sort()
	ha = fac[2 * n]
	ha = ha * pow(fac[n], p - 2, p) * pow(fac[n], p - 2, p)
	ha = ha % p
	(nn, pp) = (0, 0)
	for i in range(2 * n):
		if i < n:
			nn += ha * a[i]
			nn = nn % p
		else:
			pp += ha * a[i]
			pp = pp % p
	print((pp - nn) % p)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
mod = 998244353
n = inp()
a = inara()
a.sort()
ans = 0
for i in range(n):
	ans -= a[i]
for i in range(n, 2 * n):
	ans += a[i]
ans %= mod
fact = [1] * (2 * n + 1)
for i in range(1, 2 * n + 1):
	fact[i] = fact[i - 1] * i
	fact[i] %= mod
C = fact[2 * n] * pow(fact[n], mod - 2, mod) ** 2
C %= mod
ans *= C
ans %= mod
print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	m = int(input())
	mod = 998244353
	vals = sorted(map(int, input().split()))
	a1 = 0
	a2 = 0
	for s in range(2 * m):
		if s < m:
			a1 += vals[s]
			a1 = a1 % mod
		else:
			a2 += vals[s]
			a2 = a2 % mod
	ans = (a2 - a1) % mod

	def ncr(n, r, p):
		num = den = 1
		for i in range(r):
			num = num * (n - i) % p
			den = den * (i + 1) % p
		return num * pow(den, p - 2, p) % p
	ans *= ncr(2 * m, m, mod)
	ans = ans % mod
	print(ans)
main()


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
from collections import defaultdict
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=300006, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater

class TrieNode:

	def __init__(self):
		self.children = [None] * 26
		self.isEndOfWord = False

class Trie:

	def __init__(self):
		self.root = self.getNode()

	def getNode(self):
		return TrieNode()

	def _charToIndex(self, ch):
		return ord(ch) - ord('a')

	def insert(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				pCrawl.children[index] = self.getNode()
			pCrawl = pCrawl.children[index]
		pCrawl.isEndOfWord = True

	def search(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				return False
			pCrawl = pCrawl.children[index]
		return pCrawl != None and pCrawl.isEndOfWord

class Node:

	def __init__(self, data):
		self.data = data
		self.height = 0
		self.left = None
		self.right = None

class BinaryTrie:

	def __init__(self):
		self.root = Node(0)

	def insert(self, pre_xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = pre_xor & 1 << i
			if val == 0:
				if not self.temp.right:
					self.temp.right = Node(0)
				self.temp = self.temp.right
			elif val >= 1:
				if not self.temp.left:
					self.temp.left = Node(0)
				self.temp = self.temp.left

	def do(self, temp):
		if not temp:
			return 0
		ter = temp
		temp.height = self.do(ter.left) + self.do(ter.right)
		if temp.height == 0:
			temp.height += 1
		return temp.height

	def query(self, xor):
		self.temp = self.root
		cur = 0
		i = 31
		while i > -1:
			val = xor & 1 << i
			if not self.temp:
				return cur
			if val >= 1:
				self.opp = self.temp.right
				if self.temp.left:
					self.temp = self.temp.left
				else:
					return cur
			else:
				self.opp = self.temp.left
				if self.temp.right:
					self.temp = self.temp.right
				else:
					return cur
			if self.temp.height == pow(2, i):
				cur += 1 << i
				self.temp = self.opp
			i -= 1
		return cur
n = int(input())
l = list(map(int, input().split()))
l.sort()
s = sum(l)
sw = Combination(mod1)
s1 = 0
for i in range(n):
	s1 += l[i]
ans = s - 2 * s1
ans *= sw.ncr(2 * n, n)
ans %= mod1
print(ans)


mod = 998244353
n = int(input())
fact = [1]
inv = [1]
for i in range(1, 2 * n + 1):
	fact.append(fact[-1] * i % mod)
	inv.append(pow(fact[-1], mod - 2, mod) % mod)
a = list(map(int, input().split()))
b = a[:n]
c = a[n:]
b.sort()
c.sort(reverse=True)
s = 0
for i in range(n):
	s += abs(c[i] - b[i])
ans = fact[2 * n] * (inv[n] * inv[n] % mod) * s % mod
print(int(ans))


def res(n):
	nu = s = 1
	for i in range(n):
		nu = nu * (2 * n - i) % m
		s = s * (i + 1) % m
	return nu * pow(s, m - 2, m) % m
m = 998244353
n = int(input())
fg = sorted(list(map(int, input().split())))
f = abs(sum(fg[:n]) - sum(fg[n:]))
print(f * res(n) % m)


mod = 998244353
import math
f = math.factorial
n = int(input())
a = sorted(list(map(int, input().split())))
s = 0
s2 = 0
for i in range(2 * n):
	if i >= n:
		s2 += a[i]
	s += a[i]
tmp = 1
temp = 0
for i in range(1, 2 * n + 1):
	tmp = tmp * i % mod
	if i == n:
		temp = pow(tmp, mod - 2, mod)
print(int((s2 - s + s2) * (temp * temp * tmp) % mod) % mod)


from sys import stdin, stdout
input = stdin.readline
m = 998244353

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
t = 1
for _ in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr = sorted(arr)
	ans = abs(sum(arr[0:n]) - sum(arr[n:])) % m * ncr(2 * n, n, m) % m
	print(ans)


def bp(b, p):
	if p == 1:
		return b
	if p % 2 == 0:
		t = bp(b, p // 2)
		return t * t % q
	else:
		return bp(b, p - 1) * b % q

def inv(x):
	return bp(x, q - 2)

def div(a, b):
	return a * inv(b) % q
n = int(input())
q = 998244353
u = sorted(list(map(int, input().split())))
ans = 0
d = dict()
for i in range(n):
	ans += abs(u[i] - u[i + n])
cc = 1
for i in range(n + 1, 2 * n + 1):
	cc *= i
	cc %= q
for i in range(1, n + 1):
	cc = div(cc, i)
	cc = (q + cc) % q
print(ans * cc % q)


import sys
import math
import collections
input = sys.stdin.readline
mod = 998244353

def fact(n):
	prod = 1
	for i in range(2, n + 1):
		prod = prod * i % mod
	return prod

def ncr(n):
	k = fact(n) * fact(n) % mod
	k1 = pow(k, mod - 2, mod)
	return fact(2 * n) * k1 % mod
n = int(input())
l = sorted([int(i) for i in input().split()])
s1 = 0
s2 = 0
for i in range(n):
	s1 += l[i]
	s2 += l[n + i]
print((s2 - s1) % mod * ncr(n) % mod)


import bisect
import collections
import copy
import functools
import heapq
import itertools
import math
import random
import re
import sys
import time
import string
from typing import List
sys.setrecursionlimit(99999)
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
mod = 998244353

def inv(p):
	return pow(p, mod - 2, mod)
ans = sum(arr[n:]) - sum(arr[:n])
ans %= mod
for i in range(n):
	ans = ans * (n + i + 1) % mod
for i in range(n):
	ans = ans * inv(i + 1) % mod
print(ans)


n = int(input())
ar = sorted(list(map(int, input().split())))
ans = 0
nom = 1
dnom = 1
mod = 998244353
for i in range(n):
	ans = (ans + ar[i + n] - ar[i]) % mod
	nom = nom * (i + n + 1) % mod
	dnom = dnom * (i + 1) % mod
print(ans * nom % mod * pow(dnom, mod - 2, mod) % mod)


import os
import sys
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz/'
M = 1000000007
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
M = 998244353

def nCr(n, r, p=M):
	num = 1
	den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
n = Int()
a = sorted(array(), reverse=True)
total = nCr(2 * n, n)
ans = 0
for i in range(2 * n):
	if i < n:
		ans = (ans + a[i]) % M
	else:
		ans = (ans - a[i] + M) % M
print(total * ans % M)


def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def testcase():
	n = int(input())
	arr = list(map(int, input().split()))
	mod = 998244353
	arr.sort()
	c = ncr(2 * n, n, mod)
	ans = 0
	for i in range(n):
		ans = (ans - arr[i] * c % mod) % mod
	for i in range(n, 2 * n):
		ans = (ans + arr[i] * c % mod) % mod
	print(ans)
	return
import sys, os
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
sys.setrecursionlimit(10 ** 5)
testcase()


mod = 998244353

def fac(x):
	acc = 1
	for i in range(1, x + 1):
		acc = acc * i % mod
	return acc

def inv(x):
	return pow(x, mod - 2, mod)
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
print(sum((arr[-i - 1] - arr[i] for i in range(n))) % mod * fac(2 * n) % mod * inv(fac(n) ** 2 % mod) % mod)


from bisect import *
from collections import *
from math import gcd, ceil, sqrt, floor, inf
from heapq import *
from itertools import *
from operator import add, mul, sub, xor, truediv, floordiv
from functools import *
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())
farr = [1]
ifa = []

def fact(x, mod=0):
	if mod:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr) % mod)
	else:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr))
	return farr[x]

def ifact(x, mod):
	global ifa
	ifa.append(pow(farr[-1], mod - 2, mod))
	for i in range(x, 0, -1):
		ifa.append(ifa[-1] * i % mod)
	ifa = ifa[::-1]

def per(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return fact(i) // fact(i - j)
	return farr[i] * ifa[i - j] % mod

def com(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return per(i, j) // fact(j)
	return per(i, j, mod) * ifa[j] % mod

def catalan(n):
	return com(2 * n, n) // (n + 1)

def linc(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t > f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rinc(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t < f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def ldec(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t < f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rdec(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t > f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def binfun(x):
	c = 0
	for w in arr:
		c += ceil(w / x)
	return c

def lowbit(n):
	return n & -n

def inverse(a, m):
	a %= m
	if a <= 1:
		return a
	return (1 - inverse(m, a) * m) // a % m

class BIT:

	def __init__(self, arr):
		self.arr = arr
		self.n = len(arr) - 1

	def update(self, x, v):
		while x <= self.n:
			self.arr[x] += v
			x += x & -x

	def query(self, x):
		ans = 0
		while x:
			ans += self.arr[x]
			x &= x - 1
		return ans

class smt:

	def __init__(self, l, r, arr):
		self.l = l
		self.r = r
		self.value = (1 << 31) - 1 if l < r else arr[l]
		mid = (l + r) // 2
		if l < r:
			self.left = smt(l, mid, arr)
			self.right = smt(mid + 1, r, arr)
			self.value &= self.left.value & self.right.value

	def setvalue(self, x, val):
		if self.l == self.r:
			self.value = val
			return
		mid = (self.l + self.r) // 2
		if x <= mid:
			self.left.setvalue(x, val)
		else:
			self.right.setvalue(x, val)
		self.value = self.left.value & self.right.value

	def ask(self, l, r):
		if l <= self.l and r >= self.r:
			return self.value
		val = (1 << 31) - 1
		mid = (self.l + self.r) // 2
		if l <= mid:
			val &= self.left.ask(l, r)
		if r > mid:
			val &= self.right.ask(l, r)
		return val

class DSU:

	def __init__(self, n):
		self.c = [-1] * n

	def same(self, x, y):
		return self.find(x) == self.find(y)

	def find(self, x):
		if self.c[x] < 0:
			return x
		self.c[x] = self.find(self.c[x])
		return self.c[x]

	def union(self, u, v):
		(u, v) = (self.find(u), self.find(v))
		if u == v:
			return False
		if self.c[u] < self.c[v]:
			(u, v) = (v, u)
		self.c[u] += self.c[v]
		self.c[v] = u
		return True

	def size(self, x):
		return -self.c[self.find(x)]

class UFS:

	def __init__(self, n):
		self.parent = [i for i in range(n)]
		self.ranks = [0] * n

	def find(self, x):
		if x != self.parent[x]:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, u, v):
		(pu, pv) = (self.find(u), self.find(v))
		if pu == pv:
			return False
		if self.ranks[pu] >= self.ranks[pv]:
			self.parent[pv] = pu
			if self.ranks[pv] == self.ranks[pu]:
				self.ranks[pu] += 1
		else:
			self.parent[pu] = pv

def Prime(n):
	c = 0
	prime = []
	flag = [0] * (n + 1)
	for i in range(2, n + 1):
		if not flag[i]:
			prime.append(i)
			c += 1
		for j in range(c):
			if i * prime[j] > n:
				break
			flag[i * prime[j]] = prime[j]
			if i % prime[j] == 0:
				break
	return prime

def dij(s, graph):
	d = {}
	d[s] = 0
	heap = [(0, s)]
	seen = set()
	while heap:
		(dis, u) = heappop(heap)
		if u in seen:
			continue
		for v in graph[u]:
			if v not in d or d[v] > d[u] + graph[u][v]:
				d[v] = d[u] + graph[u][v]
				heappush(heap, (d[v], v))
	return d

def GP(it):
	res = []
	for (ch, g) in groupby(it):
		res.append((ch, len(list(g))))
	return res
t = 1
mod = 998244353
for i in range(t):
	n = N()
	a = RLL()
	fact(2 * n, mod)
	ifact(2 * n, mod)
	a.sort()
	con = com(2 * n, n, mod)
	ans = 0
	for i in range(2 * n):
		if i < n:
			ans -= con * a[i]
		else:
			ans += con * a[i]
		ans %= mod
	print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def prod(a, mod=10 ** 9 + 7):
	ans = 1
	for each in a:
		ans = ans * each % mod
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if not True else 1):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	x = a[:n]
	y = a[n:][::-1]
	val = 0
	for i in range(n):
		val += abs(x[i] - y[i])
	mod = 998244353
	max_n = 400000
	if 1:
		max_n = min(max_n, mod - 1)
		(fact, inv_fact) = ([0] * (max_n + 1), [0] * (max_n + 1))
		fact[0] = 1
		for i in range(max_n):
			fact[i + 1] = fact[i] * (i + 1) % mod
		inv_fact[-1] = pow(fact[-1], mod - 2, mod)
		for i in reversed(range(max_n)):
			inv_fact[i] = inv_fact[i + 1] * (i + 1) % mod

		def nCr_mod(n, r):
			res = 1
			while n or r:
				(a, b) = (n % mod, r % mod)
				if a < b:
					return 0
				res = res * fact[a] % mod * inv_fact[b] % mod * inv_fact[a - b] % mod
				n //= mod
				r //= mod
			return res
	print(val * nCr_mod(2 * n, n) % mod)


import sys
input = sys.stdin.buffer.readline
(n, ar) = (int(input()), list(map(int, input().split())))
ar.sort()
(p1, p2, MOD) = (1, 1, 998244353)
for u in range(1, 2 * n + 1):
	if u <= n:
		p1 = p1 * u % MOD
	else:
		p2 = p2 * u % MOD
m = p2 * pow(p1, MOD - 2, MOD) % MOD
(cc, t) = (0, m)
for u in range(1, 2 * n):
	cc = (cc + (ar[u] - ar[u - 1]) * t) % MOD
	if u < n:
		t += m
	else:
		t -= m
print(cc)


from sys import stdin
from math import floor
k = int(input())
n = 2 * k
arr = [int(x) for x in stdin.readline().split()]
arr = sorted(arr)
primes = []
degrees = []
degrees1 = []
numbers = [True] * (n + 1)
numbers[0] = False
numbers[1] = False
for i in range(2, n + 1):
	if numbers[i] == True:
		primes.append(i)
		k = i
		while i * k <= n:
			numbers[i * k] = False
			k = k + 1
for p in primes:
	s = 0
	j = 1
	while p ** j <= n:
		s = s + n // p ** j
		j = j + 1
	degrees.append(s)
k = n // 2
for p in primes:
	s = 0
	j = 1
	while p ** j <= k:
		s = s + k // p ** j
		j = j + 1
	degrees1.append(s)
ans = 1
for j in range(len(degrees)):
	degrees[j] = degrees[j] - 2 * degrees1[j]
	for i in range(degrees[j]):
		ans = ans * primes[j] % 998244353
st = sum(arr[:k]) % 998244353
en = sum(arr[k:]) % 998244353
su = (en - st) * ans % 998244353
print(su)


mod = 998244353
n = int(input())
a = sorted(list(map(int, input().split())))
c = 0
for i in range(n):
	c += abs(a[i] - a[2 * n - i - 1])
f = [1, 1]
for i in range(2, 2 * n + 1):
	f.append(f[-1] * i % mod)
print(c * (f[2 * n] * pow(f[n] * f[n] % mod, mod - 2, mod)) % mod % mod)


import itertools
import math
import sys
import os
from collections import defaultdict
from heapq import heapify, heappush, heappop

def is_debug():
	return 'PYPY3_HOME' not in os.environ

def stdin_wrapper():
	data = '5\n13 8 35 94 9284 34 54 69 123 846\n\n'
	for line in data.split('\n'):
		yield line
if not is_debug():

	def stdin_wrapper():
		while True:
			yield sys.stdin.readline()
inputs = stdin_wrapper()

def input_wrapper():
	return next(inputs)

def get_str():
	if is_debug():
		return input_wrapper()
	return input()

def get(_type):
	if _type == str:
		return get_str()
	return _type(input_wrapper())

def get_arr(_type):
	return [_type(x) for x in input_wrapper().split()]

def tuplerize(method):

	def wrap(*args, **kwargs):
		res = method(*args, **kwargs)
		if not isinstance(res, (tuple, list)):
			res = (res,)
		return res
	return wrap

@tuplerize
def solve(n, d):
	MOD = 998244353

	def price(a, b):
		return sum([abs(x - y) % MOD for (x, y) in zip(sorted(a), reversed(sorted(b)))]) % MOD
	_MAX = 2 * n + 1
	fact = [0 for _ in range(_MAX)]
	fact_top = 1
	for i in range(2, 2 * n + 1):
		fact_top = fact_top * i % MOD

	def fastpow(x, y, z):
		number = 1
		while y:
			if y & 1:
				number = number * x % z
			y >>= 1
			x = x * x % z
		return number
	fact_bot = fastpow(fact_top, MOD - 2, MOD) % MOD
	for i in reversed(range(n, 2 * n)):
		fact_bot = fact_bot * (i + 1) % MOD
	p = price(d[:len(d) // 2], d[len(d) // 2:])
	return p * fact_top * fact_bot * fact_bot % MOD
n = get(int)
a = get_arr(int)
print(*solve(n, a))


mod = 998244353

def dev(a, b):
	return a * pow(b, mod - 2, mod) % mod

def fac(a):
	d = 1
	for i in range(1, a + 1):
		d *= i
		d %= mod
	return d
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
s = sum(arr[n:]) - sum(arr[:n])
f = dev(fac(2 * n) % mod, fac(n) ** 2 % mod)
print(f * s % mod)


import sys
import math
from collections import defaultdict, Counter

def power(x, y, m):
	if y == 0:
		return 1
	p = power(x, y // 2, m) % m
	p = p * p % m
	if y % 2 == 0:
		return p
	else:
		return x * p % m

def find(n):
	p = 1
	q = 1
	c = 1
	while c <= n // 2:
		p = p * (n - c + 1) % mod
		q = q * c % mod
		c += 1
	return p * power(q, mod - 2, mod) % mod
mod = 998244353
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n):
	ans = (ans + a[i + n] - a[i]) % mod
mul = find(2 * n)
print(ans * mul % mod)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions, statistics
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout
from heapq import heappush, heappop, heapify, _heapify_max, _heappop_max
N = 300005
factorialNumInverse = [None] * (N + 1)
naturalNumInverse = [None] * (N + 1)
fact = [None] * (N + 1)

def InverseofNumber(p):
	naturalNumInverse[0] = naturalNumInverse[1] = 1
	for i in range(2, N + 1, 1):
		naturalNumInverse[i] = naturalNumInverse[p % i] * (p - int(p / i)) % p

def InverseofFactorial(p):
	factorialNumInverse[0] = factorialNumInverse[1] = 1
	for i in range(2, N + 1, 1):
		factorialNumInverse[i] = naturalNumInverse[i] * factorialNumInverse[i - 1] % p

def factorial(p):
	fact[0] = 1
	for i in range(1, N + 1):
		fact[i] = fact[i - 1] * i % p

def Binomial(N, R, p):
	ans = fact[N] * factorialNumInverse[R] % p * factorialNumInverse[N - R] % p
	return ans

def main():
	mod = 998244353
	InverseofNumber(mod)
	InverseofFactorial(mod)
	factorial(mod)
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	tc = 1
	for _ in range(tc):
		n = ri()
		a = ria()
		a = sorted(a)
		s1 = sum(a[:n])
		s2 = sum(a[n:])
		ans = (s2 - s1) * Binomial(2 * n, n, mod)
		print(ans % mod)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


mod = 998244353

class Combi:

	def __init__(self, N, mod):
		self.power = [1 for _ in range(N + 1)]
		self.rev = [1 for _ in range(N + 1)]
		self.mod = mod
		for i in range(2, N + 1):
			self.power[i] = self.power[i - 1] * i % self.mod
		self.rev[N] = pow(self.power[N], self.mod - 2, self.mod)
		for j in range(N, 0, -1):
			self.rev[j - 1] = self.rev[j] * j % self.mod

	def com(self, K, R):
		if K < R:
			return 0
		else:
			return self.power[K] * self.rev[K - R] * self.rev[R] % self.mod

	def pom(self, K, R):
		if K < R:
			return 0
		else:
			return self.power[K] * self.rev[K - R] % self.mod

def main():
	n = int(input())
	c = Combi(3 * 10 ** 5 + 10, mod)
	a = list(map(int, input().split()))
	a.sort()
	ans = c.com(2 * n, n) * (sum(a) - 2 * sum(a[:n])) % mod
	print(ans)
	return
main()


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
from itertools import permutations, combinations

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
sys.setrecursionlimit(100000)
INF = float('inf')
mod = 998244353

def fac(n):
	f = 1
	for i in range(1, n + 1):
		f = f * i % mod
	return f
n = int(data())
a = sorted(mdata())
out((sum(a[n:]) - sum(a[:n])) * fac(2 * n) * pow(fac(n), mod - 2, mod) * pow(fac(n), mod - 2, mod) % mod)


mod = 998244353
eps = 10 ** (-9)

def main():
	import sys
	input = sys.stdin.buffer.readline
	N = int(input())
	A = list(map(int, input().split()))
	A.sort()
	ans = 0
	for i in range(N):
		ans += A[-i - 1] - A[i]
	for i in range(1, N + 1):
		ans = ans * (N + i) % mod
	fac = 1
	for i in range(1, N + 1):
		fac = fac * i % mod
	print(ans * pow(fac, mod - 2, mod) % mod)
main()


mod = 998244353

def nCr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
n = int(input())
v = list(map(int, input().split()))
v[:] = sorted(v)
diff = 0
for i in range(2 * n):
	if i < n:
		diff -= v[i]
	else:
		diff += v[i]
print(int(int(nCr(2 * n, n, mod) % mod) * diff % mod))


n = int(input())
l = list(map(int, input().split()))
l.sort()
l1 = l[:n]
l2 = l[n:]
l2.sort(reverse=True)
ans = 0
for i in range(n):
	ans += abs(l1[i] - l2[i])
f = [1] * 300001
fi = [1] * 300001
a = 1
b = 1
m = 998244353
for i in range(2, 2 * n + 1):
	a *= i
	a %= m
	b *= pow(i, m - 2, m)
	b %= m
	f[i] = a
	fi[i] = b
print(ans * f[2 * n] * fi[n] * fi[n] % m)


n = int(input())
a = list(map(int, input().split()))
x = sorted(a[0:n])
y = sorted(a[n:], reverse=True)
M = 998244353
Sum = sum(map(lambda z, c: abs(z - c), x, y)) % M
count = Sum
for i in range(n * 2, n, -1):
	count = count * i % M
fact = 1
for i in range(2, n + 1):
	fact = fact * i % M
print(pow(fact, M - 2, M) * count % M)


import os, sys
from io import BytesIO, IOBase
mod = 998244353
fac = [1]
for i in range(1, 300001):
	fac.append(fac[-1] * i % mod)
fac_in = [pow(fac[-1], mod - 2, mod)]
for i in range(300000, 0, -1):
	fac_in.append(fac_in[-1] * i % mod)
fac_in.reverse()

def comb(a, b):
	if a < b:
		return 0
	return fac[a] * fac_in[a - b] * fac_in[b] % mod

def main():
	n = int(input())
	a = sorted(map(int, input().split()))
	ans = 0
	for i in range(n):
		ans += 2 * (a[-1 - i] - a[i]) * comb(2 * n - 1, n) % mod
		ans %= mod
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def pwm(a, n, mod):
	ans = 1
	while n:
		if n & 1:
			ans = ans * a % mod
		a = a * a % mod
		n >>= 1
	return ans
n = int(input())
l = [int(x) for x in input().split()]
l.sort()
(a, b) = (l[:n], l[n:])
ans = 0
mod = 998244353
dnom = 1
nom = 1
for i in range(n):
	ans += (b[i] % mod - a[i] % mod) % mod
	nom = nom * (i + 1) % mod * (2 * n - i) % mod
	dnom = dnom * (i + 1) % mod * (i + 1) % mod
gg = nom % mod * pwm(dnom, mod - 2, mod) % mod
fans = ans * gg % mod
print(fans)


def big_mod(a, b):
	if b == 0:
		return 1
	x = big_mod(a, int(b / 2))
	if b & 1:
		return x * x % MOD * a % MOD
	else:
		return x * x % MOD
n = int(input())
a = list(map(int, input().split()))
a.sort()
(x, y) = (a[:n], a[n:])
y.reverse()
sum = 0
for i in range(n):
	sum += abs(x[i] - y[i])
MOD = 998244353
fact = [1, 1]
for i in range(2, 2 * n + 1):
	fact.append(fact[i - 1] * i % MOD)
val = fact[n] * fact[n] % MOD
val = fact[2 * n] * big_mod(val, MOD - 2) % MOD
ans = sum * val % MOD
print(ans)


def ncr(n, r):
	num = 1
	den = 1
	for i in range(r):
		num = num * (n - i) % m
		den = den * (i + 1) % m
	p = num * pow(den, m - 2, m) % m
	return p
m = 998244353
n = int(input())
a = list(map(int, input().split()))
a.sort()
an = abs(sum(a[:n]) - sum(a[n:]))
s = an * ncr(2 * n, n) % m
print(s)


import sys
from math import *
from fractions import *

def main():

	def modst(a, s):
		ret = 1
		while s:
			if s % 2:
				ret = ret * a % mod
			a = a * a % mod
			s //= 2
		return ret

	def C_n_k(n, k):
		return fact[n] * modst(fact[n - k] * fact[k] % mod, mod - 2) % mod
	n = int(sys.stdin.readline().strip())
	q = sorted(list(map(int, sys.stdin.readline().split())))
	mod = 998244353
	fact = [1 for i in range(600009)]
	for i in range(2, 2 * n + 7):
		fact[i] = i * fact[i - 1] % mod
	print((sum(q[n:]) - sum(q[:n])) % mod * C_n_k(2 * n, n) % mod)
main()


mod = 998244353
n = int(input())
a = sorted(list(map(int, input().split())))
Sum = (sum(a[n:]) - sum(a[:n])) % mod
(soorat, makhraj) = (1, 1)
for i in range(n):
	soorat = soorat * (n + 1 + i) % mod
	makhraj = makhraj * (i + 1) % mod
makhraj = pow(makhraj, mod - 2, mod)
print(makhraj * soorat % mod * Sum % mod)


import sys, string
from collections import deque, defaultdict
from math import sqrt, factorial, gcd, ceil, atan, pi, log2

def input():
	return sys.stdin.buffer.readline().decode('utf-8')
from bisect import bisect_left, bisect_right
from operator import add
MOD = int(1000000000.0) + 7
INF = float('inf')
MOD = 998244353

def prod(a, b):
	ans = 1
	for x in range(a, b + 1):
		ans *= x
		ans %= MOD
	return ans

def fact(x):
	ans = 1
	while x:
		ans *= x
		ans %= MOD
		x -= 1
	return ans

def coef(n, k):
	if k > n:
		return 0
	return prod(n - k + 1, n) * pow(fact(k) % MOD, MOD - 2, MOD) % MOD

def solve():
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	(a, b) = (a[:n], a[n:])
	b = b[::-1]
	print(sum([abs(b[i] - a[i]) for i in range(n)]) * coef(n * 2, n) % MOD)
T = 1
for case in range(1, T + 1):
	ans = solve()


mod = 998244353
maxn = 300000 + 10
n = 0
Ans = 0
a = []
fact = [1] * maxn

def Pow(i, j):
	ret = 1
	while j != 0:
		if j % 2 == 1:
			ret = ret * i % mod
		i = i * i % mod
		j //= 2
	return ret
n = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(1, 2 * n + 1):
	fact[i] = fact[i - 1] * i % mod
inv = Pow(fact[n], mod - 2)
for i in range(n):
	Ans += a[i + n] - a[i]
Ans = Ans * fact[2 * n] % mod * inv % mod * inv % mod
print(Ans)


n = int(input())
mod = 998244353
(*arr,) = map(int, input().split())
arr.sort()
i = 0
j = 2 * n - 1
s = 0
while i < j:
	s += abs(arr[i] - arr[j])
	i += 1
	j -= 1
s %= mod
factorials = [1]
for i in range(1, 2 * n + 1):
	factorials.append(factorials[-1] * i % mod)
inverses = [pow(v, mod - 2, mod) for v in factorials]

def cnk(n, k):
	return factorials[n] * inverses[k] * inverses[n - k] % mod
print(s * cnk(2 * n, n) % mod)


mod = 998244353
n = int(input())
arr = [int(j) for j in input().split()]
fact = [1] * (3 * n)
for i in range(1, 3 * n):
	fact[i] = fact[i - 1] * i % mod
arr.sort()
print((sum(arr[n:]) - sum(arr[:n])) * fact[2 * n] * pow(fact[n], mod - 2, mod) ** 2 % mod)


import sys
input = sys.stdin.readline
MOD = 998244353
N = 400000
fact = [0 for _ in range(N)]
invfact = [0 for _ in range(N)]
fact[0] = 1
for i in range(1, N):
	fact[i] = fact[i - 1] * i % MOD
invfact[N - 1] = pow(fact[N - 1], MOD - 2, MOD)
for i in range(N - 2, -1, -1):
	invfact[i] = invfact[i + 1] * (i + 1) % MOD

def nCk(n, k):
	if k < 0 or n < k:
		return 0
	else:
		return fact[n] * invfact[k] * invfact[n - k] % MOD

def main():
	n = int(input())
	alst = list(map(int, input().split()))
	alst.sort()
	minus = sum(alst[:n])
	plus = sum(alst[n:])
	ans = (plus - minus) * nCk(2 * n, n)
	ans %= MOD
	print(ans)
for _ in range(1):
	main()


from sys import stdin
input = stdin.readline

def A():
	t = int(input())
	for _ in range(t):
		(n, x) = map(int, input().split())
		a = list(map(int, input().split()))
		b = list(map(int, input().split()))
		if _ != t - 1:
			input()
		b.sort(reverse=True)
		a.sort()
		truth = True
		for i in range(n):
			if a[i] + b[i] > x:
				truth = False
				break
		if truth:
			print('Yes')
		else:
			print('No')

def B():
	t = int(input())
	for _ in range(t):
		(a, b, c, d) = map(int, input().split())
		print(max(a + b, c + d))

def D():
	n = int(input())
	a = sorted(list(map(int, input().split())))
	mod = 998244353
	s = 0
	ans = sum(a)
	for i in a[0:n]:
		ans -= 2 * i
	ans %= mod
	num = 1
	denom = 1
	for i in range(n + 1, 2 * n + 1):
		num *= i
		num %= mod
	for i in range(1, n + 1):
		denom *= i
		denom %= mod
	denom = pow(denom, mod - 2, mod)
	mult = num * denom % mod
	print(mult * ans % mod)
D()


n = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
p = 998244353
x = 1
for i in range(n + 1, 2 * n + 1):
	x *= i
	x %= p
x2 = 1
for i in range(1, n + 1):
	x2 *= i
	x2 %= p
x *= pow(x2, p - 2, p)
x %= p
Ans = 0
for i in range(n):
	Ans += A[i] * x
for i in range(n):
	Ans -= A[n + i] * x
Ans %= p
print(Ans)


import os
import sys
from io import BytesIO, IOBase

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
mod = 998244353
mv = 150000

def mI(a, m):
	m0 = m
	y = 0
	x = 1
	if m == 1:
		return 0
	while a > 1:
		q = a // m
		t = m
		m = a % m
		a = t
		t = y
		y = x - q * y
		x = t
	if x < 0:
		x = x + m0
	return x
V = []
v = 1
for i in range(mv + 1):
	V.append(mI(i, mod))

def main():
	n = int(input())
	A = list(map(int, input().split()))
	ans = 0
	A.sort()
	for i in range(n):
		ans = (ans + abs(-A[i] + A[2 * n - i - 1])) % mod
	c = 1
	for i in range(n):
		c = c * (2 * n - i) % mod
		c = c * V[i + 1] % mod
	print(ans * c % mod)
main()


from sys import stdin
input = lambda : stdin.readline().strip()
n = int(input())
a = list(map(int, input().split()))
a.sort()
summ = -sum(a[:n]) + sum(a[n:])
mod = 998244353

def bin_pow(num, pow):
	if pow == 0:
		return 1
	if pow == 1:
		return num
	x = bin_pow(num, pow // 2) % mod
	if pow % 2:
		return x * x % mod * num % mod
	return x * x % mod

def div_by_mod(n1, n2):
	return n1 * bin_pow(n2, mod - 2) % mod

def C_iz_n_po_k(n, k):
	ans = 1
	divider = 1
	for i in range(k):
		ans = ans * (n - i) % mod
		divider = divider * (k - i) % mod
	return div_by_mod(ans, divider)
print(C_iz_n_po_k(2 * n, n) * summ % mod)


MOD = 998244353
n = int(input())
s = [int(x) for x in input().split()]
s.sort()
N = 2 * n
m1 = 1
for i in range(1, N + 1):
	m1 = m1 * i % MOD
m2 = 1
for i in range(1, n + 1):
	m2 = m2 * i % MOD
tt = m2 * m2 % MOD
dem = pow(tt, MOD - 2, MOD) % MOD
val = m1 * dem % MOD
ans1 = 0
for i in range(0, n):
	ans1 = ans1 + s[i]
ans2 = 0
for i in range(n, len(s)):
	ans2 = ans2 + s[i]
ans = (ans2 - ans1 + MOD) % MOD
ans = ans * val % MOD
print(ans)


from sys import *
M = 998244353
n = int(stdin.readline())
A = sorted(list(map(int, stdin.readline().split())))
(s, t) = (sum(A[n:]) - int(sum(A[:n])) % M, 1)
for i in range(1, n + 1):
	s = s * (2 * n - i + 1) % M
	t = t * i % M
stdout.write(str(pow(t, M - 2, M) * s % M) + '\n')


import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
n = n * 2
arr = list(map(int, input().split()))
MOD = 998244353
fact = [1] * (n + 1)
for i in range(2, n + 1):
	fact[i] = fact[i - 1] * i % MOD

def ncr(a, b):
	up = fact[a]
	down = fact[b] * fact[b] % MOD
	down = pow(down, MOD - 2, MOD)
	return up * down % MOD
arr.sort()
diff = 0
for i in range(n // 2):
	diff += arr[~i] - arr[i]
c = ncr(n, n // 2)
print(diff * c % MOD)


import sys
from array import array
from typing import List, Tuple, TypeVar, Generic, Sequence, Union

def input():
	return sys.stdin.buffer.readline().decode('utf-8')

def main():
	n = int(input())
	a = sorted(map(int, input().split()))
	max_n = 2 * n + 1
	mod = 998244353
	(fac, inv) = ([1] * max_n, [1] * max_n)
	for i in range(2, max_n):
		fac[i] = fac[i - 1] * i % mod
	inv[-1] = pow(fac[-1], mod - 2, mod)
	for i in range(max_n - 1, 0, -1):
		inv[i - 1] = inv[i] * i % mod
	ans = sum((abs(a[i] - a[-i - 1]) for i in range(n))) * fac[2 * n] * inv[n] * inv[n] % mod
	print(ans)
main()


from sys import stdin, stdout
MOD = 998244353

def divide_and_sum(n, a_a):
	a_a.sort()
	s = (sum(a_a[n:2 * n]) - sum(a_a[0:n])) % MOD
	c = Com(n, 2 * n)
	r = s * c % MOD
	return r

def Com(p, t):
	c1 = 1
	c2 = 1
	for i in range(p):
		c1 *= t - i
		c1 %= MOD
		c2 *= i + 1
		c2 %= MOD
	c = c1 * inverse(c2)
	c %= MOD
	return c

def inverse(a):
	return bpower(a, MOD - 2)

def bpower(a, p):
	if p == 0:
		return 1
	r = bpower(a, p // 2)
	r *= r
	r %= MOD
	if p % 2 == 1:
		r *= a
	r %= MOD
	return r
n = int(stdin.readline())
a_a = list(map(int, stdin.readline().split()))
r = divide_and_sum(n, a_a)
stdout.write(str(r))


n = int(input())
(*a,) = map(int, input().split())
a.sort()
ans = sum((a[2 * n - i - 1] - a[i] for i in range(n)))
m = 998244353
for i in range(n):
	ans *= 2 * n - i
	ans *= pow(i + 1, m - 2, m)
	ans %= m
print(ans)