This problem differs from the next one only in the presence of the constraint on the equal length of all numbers $a_1, a_2, \dots, a_n$. Actually, this problem is a subtask of the problem D2 from the same contest and the solution of D2 solves this subtask too.

A team of SIS students is going to make a trip on a submarine. Their target is an ancient treasure in a sunken ship lying on the bottom of the Great Rybinsk sea. Unfortunately, the students don't know the coordinates of the ship, so they asked Meshanya (who is a hereditary mage) to help them. He agreed to help them, but only if they solve his problem.

Let's denote a function that alternates digits of two numbers $f(a_1 a_2 \dots a_{p - 1} a_p, b_1 b_2 \dots b_{q - 1} b_q)$, where $a_1 \dots a_p$ and $b_1 \dots b_q$ are digits of two integers written in the decimal notation without leading zeros.

In other words, the function $f(x, y)$ alternately shuffles the digits of the numbers $x$ and $y$ by writing them from the lowest digits to the older ones, starting with the number $y$. The result of the function is also built from right to left (that is, from the lower digits to the older ones). If the digits of one of the arguments have ended, then the remaining digits of the other argument are written out. Familiarize with examples and formal definitions of the function below.

For example: $$f(1111, 2222) = 12121212$$ $$f(7777, 888) = 7787878$$ $$f(33, 44444) = 4443434$$ $$f(555, 6) = 5556$$ $$f(111, 2222) = 2121212$$

Formally,  if $p \ge q$ then $f(a_1 \dots a_p, b_1 \dots b_q) = a_1 a_2 \dots a_{p - q + 1} b_1 a_{p - q + 2} b_2 \dots a_{p - 1} b_{q - 1} a_p b_q$;  if $p < q$ then $f(a_1 \dots a_p, b_1 \dots b_q) = b_1 b_2 \dots b_{q - p} a_1 b_{q - p + 1} a_2 \dots a_{p - 1} b_{q - 1} a_p b_q$. 

Mishanya gives you an array consisting of $n$ integers $a_i$. All numbers in this array are of equal length (that is, they consist of the same number of digits). Your task is to help students to calculate $\sum_{i = 1}^{n}\sum_{j = 1}^{n} f(a_i, a_j)$ modulo $998\,244\,353$.


-----Input-----

The first line of the input contains a single integer $n$ ($1 \le n \le 100\,000$) — the number of elements in the array. The second line of the input contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^9$) — the elements of the array. All numbers $a_1, a_2, \dots, a_n$ are of equal length (that is, they consist of the same number of digits).


-----Output-----

Print the answer modulo $998\,244\,353$.


-----Examples-----
Input
3
12 33 45

Output
26730
Input
2
123 456

Output
1115598
Input
1
1

Output
11
Input
5
1000000000 1000000000 1000000000 1000000000 1000000000

Output
265359409

Difficulty: MEDIUM

Solutions:
n = int(input())
a = list(map(str, input().split()))
ans = 0
mod = 998244353
for i in range(n):
	s = ''
	for j in range(0, len(a[i])):
		s += a[i][j]
		s += a[i][j]
	x = int(s)
	ans += x % mod * n % mod
print(ans % mod)


MOD = 998244353

def cntFt(i):
	cnt = 1
	ans = 0
	while i:
		ans += 10 ** cnt * (i % 10)
		i //= 10
		cnt += 2
	return ans

def cntSd(i):
	cnt = 0
	ans = 0
	while i:
		ans += 10 ** cnt * (i % 10)
		i //= 10
		cnt += 2
	return ans
n = int(input())
sum = 0
for i in list(map(int, input().split())):
	sum += cntFt(i) * n
	sum += cntSd(i) * n
print(sum % MOD)


n = int(input())
l = list(map(int, input().split()))
M = 998244353
ans = 0
m = len(str(l[0]))
for x in l:
	s = ''.join([c * 2 for c in str(x)])
	s = int(s) % M
	ans = (ans + s * n) % M
print(ans)


b = 998244353
n = int(input())
arr = input().split()
s = 0
for a in arr:
	l = list(a)
	l1 = int(''.join(['%s0' % x for x in l]))
	l2 = int(''.join(['0%s' % x for x in l]))
	s = (s + l1 * n) % b
	s = (s + l2 * n) % b
print(s)


n = int(input())
a = list(map(int, input().split()))
b = []
sum1 = 0

def reverse(string):
	string = ''.join(reversed(string))
	return string
for i in range(n):
	t = a[i]
	s = ' '
	c = []
	while t > 0:
		x = t % 10
		s = s + str(x)
		s = s + str(x)
		t = t // 10
	s = reverse(s)
	b.append(s)
for i in range(len(b)):
	x = int(b[i])
	sum1 += x * n
print(sum1 % 998244353)


n = int(input())
a = list(input().split())
ans = 0
for x in a:
	num = ''
	for y in x:
		num += y + y
	num = int(num)
	ans += num
	ans %= 998244353
ans *= n
ans %= 998244353
print(ans)


n = int(input())
line = input().split()
a = []
for num in line:
	a.append(int(num))
res = 0
for x in a:
	place = 1
	while x > 0:
		digit = x % 10
		res += n * digit * place
		place *= 10
		res += n * digit * place
		x //= 10
		place *= 10
		res %= 998244353
print(res % 998244353)


mod = 998244353
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(n):
	x = a[i]
	(cur, pw) = (0, 1)
	while x:
		cur += 11 * (x % 10) * pw
		x = x // 10
		pw *= 100
	s += cur
	if s >= mod:
		s %= mod
print(s * n % mod)


def f(a):
	b = ''
	for digit in a:
		b += 2 * digit
	return int(b)
n = int(input())
a = input().split()
ans = 0
for num in a:
	ans += f(num) * n
print(ans % 998244353)


mod = 998244353

def cal(a, b, n):
	arr_a = list(map(int, str(a)))
	arr_b = list(map(int, str(b)))
	ans_a = ''
	for i in range(len(arr_a)):
		ans_a += str(arr_a[i]) + '0'
	ans_b = ''
	for i in range(len(arr_b)):
		ans_b += '0' + str(arr_b[i])
	ans_a = int(ans_a) % mod
	ans_b = int(ans_b) % mod
	return (ans_a + ans_b) % mod
n = int(input())
arr = list(map(int, input().split()))
ans = 0
for i in range(n):
	ans = (cal(arr[i], arr[i], n) + ans) % mod
ans = ans * (n % mod) % mod
print(ans)


n = int(input())
ls = list(map(int, input().split()))
cnt = 0
mod = 998244353
for num in ls:
	j = 1
	for i in str(num)[::-1]:
		cnt += int(i) * j * n % mod
		cnt += int(i) * (j * 10) * n % mod
		j *= 100
print(cnt % mod)


_MODER = 998244353

def solve(n, a):
	r = 0
	for e in a:
		ns = ''
		for ch in str(e):
			ns += ch + ch
		r = (r + int(ns) * n % _MODER) % _MODER
	return r
n = int(input())
a = list(map(int, input().split()))
r = solve(n, a)
print(r)


import sys
input = sys.stdin.readline
n = int(input())
A = list(input().split())
mod = 998244353

def dup(a):
	ANS = ''
	for k in a:
		ANS += k * 2
	return int(ANS)
B = [dup(a) for a in A]
ANS = 0
for b in B:
	ANS = (ANS + b * n) % mod
print(ANS)


from sys import stdin
import math
from collections import defaultdict, deque
import bisect
I = stdin.readline
mod = 998244353

def fun(n):
	p = 0
	x = 0
	while n != 0:
		rem = n % 10
		n -= rem
		rem = rem * pow(10, 2 * p, mod) % mod
		x += rem
		x %= mod
		p += 1
		n /= 10
	return x
n = int(I())
arr = [int(x) for x in I().split()]
ans = 0
for i in arr:
	x = fun(i)
	y = 10 * x % mod
	x *= n
	x %= mod
	y *= n
	y %= mod
	ans += (x + y) % mod
	ans %= mod
print(int(ans))


n = int(input())
l = list(map(int, input().split()))
s = 0
for x in l:
	k = x
	i = 0
	while k:
		d = k % 10
		k //= 10
		s += d * int('1' + '0' * (2 * i))
		s %= 998244353
		i += 1
s = s * 11 * n
s %= 998244353
print(s)


n = int(input())
A = [int(i) for i in input().split()]
k = len(str(A[0]))
sum = 0
for i in A:
	for (index, c) in enumerate(str(i)[::-1]):
		l = int(c)
		sum += (l + 10 * l) * 10 ** (index * 2)
sum *= n
print(sum % 998244353)


n = int(input())
l = [int(i) for i in input().split()]

def liste(n):
	l = []
	while n != 0:
		l.append(n % 10)
		n //= 10
	return l

def aug1(l):
	l.reverse()
	res = []
	for k in l:
		res.append(k)
		res.append(0)
	s = 0
	for k in res:
		s += k
		s *= 10
	s //= 10
	return s

def aug2(l):
	l.reverse()
	res = []
	for k in l:
		res.append(k)
		res.append(0)
	res.pop()
	s = 0
	for k in res:
		s += k
		s *= 10
	s //= 10
	return s
s = 0
modulo = 998244353
for k in l:
	s += n * (aug1(liste(k)) + aug2(liste(k)))
	s = s % modulo
print(s)


a = int(input())
c = list(map(int, input().split()))
summ = 0
for i in range(a):
	k = 0
	k1 = 0
	s = str(c[i])
	for x in s:
		k = k * 100 + int(x)
	k1 = k * 10
	summ += (k + k1) * a
	summ %= 998244353
print(summ)


n = int(input())
a = []
b = map(int, input().split())
a = list(b)

def f(k):
	smal = 0
	big = 0
	step = 1
	while k > 0:
		ost = k % 10
		smal += ost * step
		big += ost * step * 10
		k = k // 10
		step *= 100
	return big + smal
summ = 0
for i in range(n):
	summ += n * f(a[i])
summ = summ % 998244353
print(summ)


n = int(input())
l = list(map(int, input().split()))
ans = 0
for j in range(10):
	for i in range(n):
		x = l[i] % 10
		l[i] //= 10
		lav = pow(10, 2 * j)
		ans += (lav * x + lav * 10 * x) * n
		ans %= 998244353
print(ans)


n = int(input())
a = list(map(str, input().split()))
ans = 0
for t in a:
	s = ''
	for j in t:
		s += 2 * j
	ans += int(s)
	ans %= 998244353
print(n * ans % 998244353)


import io, sys
input = lambda f=io.StringIO(sys.stdin.buffer.read().decode()).readline: f().rstrip()
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
MOD = 998244353
pow10 = [10 ** i % MOD for i in range(61)]
n = ii()
a = li()
ans = 0
for x in a:
	for i in range(30):
		d = x % 10
		ans += (pow10[2 * i] + pow10[2 * i + 1]) * d % MOD
		x //= 10
	ans %= MOD
print(ans * n % MOD)


n = int(input())
a = list(map(str, input().split()))
l = len(a[0])
ans = 0
for i in a:
	c = ''
	for j in i:
		c += '0' + j
	ans += int(c) * n
	c = ''
	for j in i:
		c += j + '0'
	ans += int(c) * n
print(ans % 998244353)


n = int(input())
a = [int(x) for x in input().split()]
ans = 0
mod = 998244353

def f1(x):
	ret = 0
	i = 1
	while x != 0:
		ret += x % 10 * 10 ** (i * 2 - 1)
		i += 1
		x //= 10
	return ret

def f2(x):
	ret = 0
	i = 1
	while x != 0:
		ret += x % 10 * 10 ** (i * 2 - 2)
		i += 1
		x //= 10
	return ret
for i in a:
	t = f1(i) * n % mod
	ans += t
	ans %= mod
	t = f2(i) * n % mod
	ans += t
	ans %= mod
print(ans % mod)


n = int(input())
c = 998244353
ans = 0
v = input().split()
for now in v:
	for j in range(len(now)):
		ans += int(now[j]) * n * 10 ** (2 * (len(now) - j) - 1)
		ans += int(now[j]) * n * 10 ** (2 * (len(now) - j) - 2)
		ans %= c
print(ans)


print(11 * int(input()) * sum((int('0'.join(x)) for x in input().split())) % 998244353)


n = int(input())
array = input().split(' ')
ans = 0
for i in array:
	p = 1
	for j in i[::-1]:
		num = int(j)
		ans += num * 11 * n * p
		p *= 100
		ans = ans % 998244353
print(ans)


from sys import stdin, stdout

def getmin(x):
	res = ''
	for c in x:
		res += c + '0'
	return int(res)

def getmax(x):
	res = ''
	for c in x:
		res += '0' + c
	return int(res)

def main():
	I = stdin.readline
	O = stdout.write
	MOD = 998244353
	n = int(I().strip())
	a = I().strip().split()
	res = 0
	for e in a:
		res += getmin(e)
		res += getmax(e)
	O(str(res % MOD * n % MOD))
main()


n = int(input())
A = [list(x) for x in input().split()]
res = 0
for i in range(len(A)):
	L = A[i]
	buf = []
	for j in range(len(L)):
		buf.append(L[j])
		buf.append(L[j])
	res += int(''.join(buf)) * n % 998244353
print(res % 998244353)


mod = 998244353

def main():
	n = int(input())
	A = list(map(int, input().split()))
	N = 10 ** 6
	table = [0] * (N + 1)
	table[0] = 1
	for i in range(1, N + 1):
		table[i] = table[i - 1] * 10
		table[i] %= mod
	ans = 0
	for (i, a) in enumerate(A):
		a = str(a)
		a = list(a)
		a.reverse()
		for (j, c) in enumerate(a):
			c = int(c)
			ans += c * table[2 * j + 1] * n + c * table[2 * j] * n
			ans %= mod
	print(ans)
main()


def transform(A, N):
	A_ = str(A)
	sum = 0
	for i in range(len(A_)):
		C = int(A_[-i - 1])
		sum += C * (11 * N) * 100 ** i
	return sum % 998244353
N = int(input())
A = input().split()
A = list(map(int, A))
result = 0
for i in range(N):
	result += transform(A[i], N)
	result = result % 998244353
print(result)


import math
from collections import deque, defaultdict
from sys import stdin, stdout
input = stdin.readline
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())

def doTheThing(s):
	t = ''
	for i in s:
		t += i
		t += i
	return int(t)
n = int(input())
a = list(input().split())
a = [doTheThing(i) for i in a]
ans = 0
for i in a:
	ans += i * n % 998244353
	ans %= 998244353
print(ans)


n = int(input())
su = 0
a = list(map(int, input().split()))
for t in range(n):
	s = str(a[t])
	count = 0
	for i in range(len(s)):
		q = ord(s[i]) - ord('0')
		count = count * 10 + q
		count = count * 10 + q
	su += count
	su %= 998244353
su *= n
su %= 998244353
print(su)


def main():
	mod = 998244353
	n = int(input())
	arr = list(map(int, input().split()))
	ans = 0
	for i in arr:
		x = str(i)
		l = 2 * len(x) - 1
		for j in x:
			val = pow(10, l, mod)
			val *= n * int(j)
			val = val % mod
			ans += val
			l -= 1
			val = pow(10, l, mod)
			val *= n * int(j)
			val = val % mod
			ans += val
			l -= 1
	print(ans % mod)
main()


import sys
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
MOD = 998244353
nb = RI()
na = [x for x in input().split()]
ans = 0
for x in na:
	current = ''
	for y in x:
		current += y * 2
	current = int(current)
	ans += current
	ans %= MOD
ans *= nb
ans %= MOD
print(ans)


import sys
input = sys.stdin.readline
read = lambda : map(int, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

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

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

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(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 swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

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

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

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
from bisect import bisect_left

def f(a, b):
	a = str(a)
	b = str(b)
	fun = ''
	for i in range(2 * len(a)):
		if i % 2 == 0:
			fun = fun + a[i // 2]
		else:
			fun = fun + b[i // 2]
	return int(fun)

def solve():
	quesmod = 998244353
	n = int(input())
	a = list(read())
	ans = 0
	for x in a:
		ans += n * f(x, x) % quesmod
	print((ans + quesmod) % quesmod)
for _ in range(1):
	solve()


MOD = 998244353
n = int(input())
a = [item for item in input().split()]
ans = 0
for item in a:
	for (i, ch) in enumerate(item[::-1]):
		ans += int(ch) * 100 ** i * 11 * n
		ans %= MOD
print(ans)


import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right, bisect
MOD = 998244353
pow10 = []
curr = 1
for _ in range(20):
	pow10.append(curr)
	curr *= 10
	curr %= MOD
n = int(input())
a = list(map(int, stdin.readline().split()))
ans = 0
for i in a:
	temp = i
	c1 = 0
	c2 = 0
	dig = 0
	while temp > 0:
		x = temp % 10
		c1 += x * pow10[dig] % MOD
		dig += 2
		temp = temp // 10
	temp = i
	dig = 1
	while temp > 0:
		x = temp % 10
		c2 += x * pow10[dig] % MOD
		dig += 2
		temp = temp // 10
	c1 %= MOD
	c2 %= MOD
	ans += c1 * n % MOD
	ans += c2 * n % MOD
	ans %= MOD
print(ans)


mod = 998244353
n = int(input())
a = [int(i) for i in input().split()]
s = 0
b = ''
for i in range(n):
	s1 = str(a[i])
	b = ''
	for i in range(len(s1)):
		b = b + s1[i] + s1[i]
	s += int(b) % mod
print(s * n % mod)


n = int(input())
arr = [int(x) for x in input().split()]
ans = 0
mod = 998244353
for x in range(n):
	gv = str(arr[x])
	num = 0
	for i in gv:
		num = num * 10 + int(i)
		num = num * 10 + int(i)
	ans += num * n
print(ans % mod)


n = int(input())
sum = 0
mod = 998244353
a = [int(s) for s in input().split()]
for i in range(n):
	d = 10
	now = a[i]
	while now > 0:
		h = now % 10
		now //= 10
		sum += h * d // 10 % mod * n % mod
		sum += h * d % mod * n % mod
		sum %= mod
		d *= 100
print(sum % mod)


MOD = 998244353
n = int(input())
v = [i[::-1] for i in input().split()]
for i in range(n):
	s = ''
	for j in range(len(v[i])):
		s += v[i][j] + v[i][j]
	v[i] = s
res = 0
for i in range(n):
	for j in range(len(v[i])):
		res += 10 ** j * int(v[i][j]) % MOD
		res %= MOD
print(res * n % MOD)


n = int(input())
line = input()
mod = 998244353
ret = 0
for snum in line.split(' '):
	num = int(snum)
	cnt = 1
	while num:
		i = num % 10
		ret += n * (cnt * i + cnt * 10 * i)
		ret %= mod
		cnt *= 100
		num //= 10
print(ret)


n = int(input())
a = input().split()
ans = 0
for i in range(0, n):
	l = len(a[i]) * 2
	l = l - 1
	for j in range(0, len(a[i])):
		ans = ans + int(a[i][j]) * 10 ** l * n
		l -= 1
		ans = ans + int(a[i][j]) * 10 ** l * n
		l -= 1
print(ans % 998244353)


def transform1(num1):
	x = str(num1)
	y = ''
	for ch in x:
		y += ch
		y += '0'
	return int(y)

def transform2(num2):
	x = str(num2)
	y = ''
	for i in range(len(x) - 1):
		y += x[i]
		y += '0'
	y += x[len(x) - 1]
	return int(y)
import sys
mod = 998244353
n = int(input())
a = list(map(int, sys.stdin.readline().split()))
ans = 0
sum1 = 0
sum2 = 0
for i in range(n):
	sum1 += transform1(a[i])
	sum2 += transform2(a[i])
ans = (sum1 + sum2) * n % mod
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
d = [0 for i in range(10)]
for i in a:
	k = 0
	while i != 0:
		d[k] += i % 10
		i = i // 10
		k += 1
res = 0
k = 0
for i in d:
	res += i * n * 11 * 10 ** k % 998244353
	k += 2
print(res % 998244353)


n = int(input())
a = []
a = input().split()
ilist = [n * int('0'.join(s) + '0') for s in a]
jlist = [n * int('0'.join(s)) for s in a]
res = sum(ilist) + sum(jlist)
print(res % 998244353)


def f(a, b):
	st = ''
	for (x, y) in zip(a, b):
		st += y + x
	return int(st)
n = int(input())
A = input().split(' ')
sum = 0
for x in A:
	sum = (sum + n * f(x, x) % 998244353) % 998244353
print(sum)


import sys
from collections import defaultdict

def main():
	n = int(input())
	a = list(map(int, input().split()))
	MOD = 998244353
	res = 0
	for i in range(n):
		curr = a[i]
		pow10 = 1
		while curr > 0:
			x = 0
			x = (x + curr % 10 * pow10 % MOD) % MOD
			pow10 *= 10
			x = (x + curr % 10 * pow10 % MOD) % MOD
			pow10 *= 10
			x = x * n % MOD
			res = (res + x) % MOD
			curr //= 10
	print(res)
main()


n = int(input())
a = [int(i) for i in input().split()]
m = 998244353
s = []
tot_sum = 0
for i in range(n):
	s1 = str(a[i])
	s2 = str(a[i])
	s3 = ''
	for k in range(len(s1)):
		s3 += s1[k] + s2[k]
	tot_sum += int(s3) % m
tot_sum *= n
print(tot_sum % m)


md = 998244353
n = int(input())
a = list(map(int, input().split()))
sm = 0
for i in range(n):
	j = 1
	s = str(a[i])
	for k in range(len(s) - 1, -1, -1):
		sm = (sm + int(s[k]) * j) % md
		j *= 100
ans = 0
print(n * 11 * sm % md)


def gns():
	return list(map(int, input().split()))
n = int(input())
ns = input().split()

def db(x):
	ans = ''
	for c in x:
		ans += c * 2
	return ans
md = 998244353
ns = [int(db(x)) % md for x in ns]
sm = sum(ns)
print(sm * n % md)


prime = 998244353
from collections import defaultdict
from math import sqrt
t = 1
for test in range(t):
	n = int(input())
	arr = list(input().split())
	ans = 0
	for i in arr:
		place = 1
		for j in range(len(i) - 1, -1, -1):
			ans = (ans + n * place * int(i[j])) % prime
			ans = (ans + n * place * int(i[j]) * 10) % prime
			place = place * 100
	print(ans)


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations

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

def num():
	return map(int, input().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg
mm = 998244353
yp = 0

def solve():
	t = 1
	for tt in range(t):
		n = nu()
		pre = [0] * n
		a = [0] * n
		ll = li()
		for i in range(n):
			x = str(ll[i])
			w = 1
			ss = 0
			w1 = 10
			for j in range(len(x) - 1, -1, -1):
				ss = (ss + int(x[j]) * w) % mm
				w = w * 100 % mm
				a[i] = (a[i] + int(x[j]) * w1) % mm
				w1 = w1 * 100 % mm
			pre[i] = ss
		for i in range(1, n):
			pre[i] = (pre[i - 1] + pre[i]) % mm
		op = (pre[n - 1] * n % mm + sum(a) * n % mm) % mm
		print(op)
solve()


n = int(input())
a = list(map(str, input().split()))
mod = 998244353
ans = 0
for i in range(n):
	for j in range(len(a[i])):
		ans += int(a[i][len(a[i]) - j - 1]) * (10 ** (2 * j) + 10 ** (2 * j + 1))
		ans %= mod
print(ans * n % mod)


mod = 998244353

def mrg(x):
	res = 0
	s = list(map(int, str(x)))
	for n in s:
		res *= 10
		res += n
		res %= mod
		res *= 10
		res += n
		res %= mod
	return res % mod
x = int(input())
s = list(map(int, input().split()))
res = 0
for n in s:
	res = (mrg(n) + res) % mod
print(res * x % mod)


n = int(input())
l = list(map(int, input().split()))
answer = 0
mod = 998244353
for val in l:
	itr = 0
	while val > 0:
		cur = val % 10
		val //= 10
		answer += n * cur * 10 ** itr % mod
		itr += 1
		answer += n * cur * 10 ** itr % mod
		itr += 1
		answer %= mod
print(answer)


mo = 998244353
n = int(input())
l = [int(s) for s in input().split()]
su = 0
for i in range(n):
	pre = 1
	re = l[i]
	while re > 0:
		temp = re % 10
		re = re // 10
		su += temp % mo * pre % mo * n
		su = su % mo
		pre = pre * 10
		pre = pre % mo
		su += temp % mo * pre % mo * n
		pre = pre * 10
		pre = pre % mo
		su = su % mo
print(su)


n = int(input())
a = input().split()
ans = 0
for i in a:
	k = int(''.join(map(''.join, zip(i, i))))
	ans = ans + n * k
print(ans % 998244353)


n = int(input())
num = input().rstrip().split(' ')
ans = 0
for i in num:
	check = len(i)
	for j in range(check):
		ans += 11 * n * int(i[check - j - 1]) * 10 ** (j * 2)
	ans %= 998244353
print(ans)


import sys
inf = float('inf')

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

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

def input():
	return sys.stdin.readline().strip()
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
mod = 998244353
n = int(input())
Arr = get_array()
result1 = []
result2 = []
for i in range(n):
	x = str(Arr[i])
	ans1 = ''
	ans2 = ''
	length = len(x)
	for j in range(length):
		ans1 += x[j]
		ans1 += '0'
	result1.append(int(ans1))
	result2.append(int(ans1[:-1]))
total = sum(result2)
final = 0
for i in range(n):
	final += result1[i] * n + total
final = final % mod
print(final)


def solve(t):
	s = []
	for i in range(len(t)):
		s.append(t[i])
		s.append(t[i])
	s = int(''.join(s)) % 998244353
	return s
res = 0
n = int(input())
a = list(map(int, input().split(' ')))
for i in range(n):
	t = str(a[i])
	s = solve(t)
	res += n * s
print(res % 998244353)


from sys import stdin, stdout, exit
mod = 998244353
n = int(input())
a = list(map(int, stdin.readline().split()))
ans = 0

def space_out(x):
	ans = []
	for c in str(x):
		ans.append(c)
		ans.append('0')
	return int(''.join(ans[:-1]))
for i in range(n):
	x = a[i]
	ans += n * 11 * space_out(x)
	ans %= mod
stdout.write(str(ans) + '\n')


n = int(input())
l = list(map(str, input().split()))
m = 998244353
ans = 0
for i in range(n):
	s = ''
	for j in range(len(l[i])):
		s += '0'
		s += l[i][j]
	ans = (ans + int(s)) % m
ans = ans * n % m
k = ans * 10 % m
ans = (ans + k) % m
print(ans % m)


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

def func(x, y):
	ln = len(y)
	s = ''
	for i in range(ln):
		s = s + x[i] + y[i]
	return int(s)
num = 0
for i in range(n):
	num += func(a[i], a[i])
print(num * n % 998244353)


def cal(x):
	x = str(x)
	y = str(x)
	k = [0] * (2 * len(x))
	m = 0
	n = 0
	for i in range(2 * len(x)):
		if i % 2 == 0:
			k[i] = x[m]
			m += 1
		else:
			k[i] = y[n]
			n += 1
	return int(''.join(k))
n = int(input())
l = list(map(int, input().split()))
m = 998244353
ans = 0
for i in range(n):
	z = cal(l[i])
	ans = (ans % m + z % m) % m
print(n % m * ans % m % m)


MOD = 998244353
n = int(input())
a = [int(w) for w in input().split()]

def pad(x, k):
	e = 1
	r = 0
	while x > 0:
		r += e * (x % 10)
		x //= 10
		e *= 100 if k > 0 else 10
		k -= 1
	return r
r = 0
for x in a:
	r = (r + pad(x, 57)) % MOD
print(r * n * 11 % MOD)


print(11 * int(input()) * sum(map(int, '0'.join(input()).split('0 0'))) % 998244353)


mod = 998244353
n = int(input())
a = list(map(int, input().split()))
sum = 0
ten = []
keep = 1
ten.append(keep)
for i in range(1, 30):
	keep *= 10
	ten.append(keep)
for i in a:
	copy = i
	cur = 0
	while copy > 0:
		digit = copy % 10
		copy //= 10
		digit *= n
		sum += digit * ten[cur]
		cur += 1
		sum += digit * ten[cur]
		cur += 1
print(sum % mod)


n = int(input())
v = list(map(int, input().split()))
a = []
b = []
for i in v:
	a_ = ''
	b_ = ''
	for x in str(i):
		a_ += x + '0'
		b_ += '0' + x
	a.append(int(a_))
	b.append(int(b_))
MOD = 998244353
f = 0
for (i, x) in enumerate(a):
	f = (f + x + b[i]) % MOD
print(n * f % MOD)


n = int(input())
mod = 998244353
ans = 0
arr = list(map(int, input().split(' ')))
for i in range(n):
	x = arr[i]
	curr = str(x)
	req1 = curr[0]
	for j in range(1, len(curr)):
		req1 += '0'
		req1 += curr[j]
	req2 = req1 + '0'
	v1 = int(req2)
	v2 = int(req1)
	v1 = v1 % mod * (n % mod) % mod
	v2 = v2 % mod * (n % mod) % mod
	ans = (ans % mod + v1 % mod) % mod
	ans = (ans % mod + v2 % mod) % mod
print(ans)


def submarine(n, arr):
	sum = 0
	for num in arr:
		for (i, ch) in enumerate(reversed(str(num))):
			x = int(ch)
			sum += x * n * 10 ** (i * 2) + n * x * 10 ** (i * 2 + 1)
	return sum
n = int(input())
arr = [int(x) for x in input().split(' ')]
print(submarine(n, arr) % 998244353)


n = int(input())
s = 0
mod = 998244353
l = input().split()
for i in l:
	s = (s + int('0'.join(list(i))) % mod) % mod
s = s * (n * 11 % mod) % mod
print(s)


n = int(input())
arr = list(map(int, input().split()))
mod = 998244353
ans = 0
for i in range(n):
	s1 = str(arr[i])
	count = 0
	for j in s1[::-1]:
		num = int(j)
		val = n * num % mod
		ans = (ans + pow(10, count, mod) * val % mod) % mod
		ans = (ans + pow(10, count + 1, mod) * val % mod) % mod
		count += 2
print(ans)


def MI():
	return map(int, input().split())

def I():
	return int(input())

def LI():
	return [int(i) for i in input().split()]
from collections import defaultdict
d = defaultdict(int)
mo = 998244353
n = I()
a = LI()
ans = 0
for i in range(n):
	d = 0
	t = 0
	for k in list(str(a[i]))[::-1]:
		j = int(k)
		t += n * 11 * j * 10 ** d
		t %= mo
		d += 2
	ans += t
	ans %= mo
print(ans)


def my_pow(cur):
	ans = 1
	for _ in range(cur):
		ans *= 10
	return ans
mod = 998244353
n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in a:
	copy = i
	cur = 0
	while copy > 0:
		digit = copy % 10
		copy //= 10
		digit *= n
		sum += digit * pow(10, cur)
		cur += 1
		sum += digit * pow(10, cur)
		cur += 1
		sum %= mod
print(sum % mod)


n = int(input())
l = input().split()
ans = 0
for i in l:
	temp = ''
	for j in i:
		temp += j + j
	ans += int(temp) % 998244353
print(ans * n % 998244353)


MOD = 998244353
n = int(input())
a = list(map(int, input().split()))
digits = [0] * 20
for i in range(n):
	st = [int(i) for i in str(a[i])][::-1]
	for j in range(len(st)):
		digits[2 * j] += n * st[j]
		digits[2 * j + 1] += n * st[j]
		digits[2 * j] %= MOD
		digits[2 * j + 1] %= MOD
total = 0
for i in range(20):
	total = (total + digits[i] * 10 ** i) % MOD
print(total)


import sys
import math as mt
import bisect
input = sys.stdin.readline
t = 1
mod = 998244353

def ncr_util():
	inv[0] = inv[1] = 1
	fact[0] = fact[1] = 1
	for i in range(2, 300001):
		inv[i] = inv[i % p] * (p - p // i) % p
	for i in range(1, 300001):
		inv[i] = inv[i - 1] * inv[i] % p
		fact[i] = fact[i - 1] * i % p

def solve():
	l1 = [0 for j in range(10)]
	for i in range(n):
		x = l[i]
		j = 0
		while x:
			l1[j] += x % 10
			x //= 10
			j += 1
	for j in range(10):
		l1[j] *= n
	suma = 0
	mul = 1
	for j in range(10):
		for i in range(2):
			suma = (suma % mod + mul % mod * (l1[j] % mod) % mod) % mod
			mul = mul % mod * 10 % mod % mod
	return suma % mod
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	print(solve())


MOD = int(998244353)

def change(s):
	n = int(0)
	for i in s:
		n = n * 100 + int(i)
		n = n % MOD
	return n
result = int(0)
n = int(input())
l = list(map(str, input().split(' ')))
for i in range(n):
	number = l[i]
	result += change(number)
	result = result % MOD
result = 11 * n * result
result = result % MOD
print(result)


pri = 998244353
a = int(input())
z = list(map(int, input().split()))
total = 0
for i in range(len(z)):
	m = str(z[i])
	for i in range(len(m) - 1, -1, -1):
		x = len(m) - 1 - i
		x = 2 * x
		total += (int(m[i]) * pow(10, x, pri) + int(m[i]) * pow(10, x + 1, pri)) * a
		total %= pri
print(total)


MOD = 998244353
n = int(input())
r = input().split()
s = 0
for t in r:
	p = 0
	for d in t:
		p = (p * 100 + int(d)) % MOD
	s += p
	s %= MOD
print(11 * n * s % MOD)


import itertools

def F(s):
	a = ''
	for i in s:
		a += i * 2
	return int(a)
n = int(input())
a = input().split()
print(sum(list(map(F, a))) * n % 998244353)


n = int(input())
a = []
m = 998244353
for i in input().strip().split(' '):
	t = ''
	for x in i:
		t += x * 2
	a.append(int(t))
ans = 0
for i in a:
	ans = (ans + i * n) % m
print(ans % m)


n = int(input())
a = list(input().split())
total = 0
for num in a:
	new = ''
	for digit in num:
		new += 2 * digit
	total = (total + n * int(new)) % 998244353
print(total)


def ft(x):
	res = ''
	s = str(x)
	for i in s:
		res += i
		res += '0'
	return int(res)

def st(x):
	res = ''
	s = str(x)
	res += s[0]
	for i in s[1:]:
		res += '0'
		res += i
	return int(res)
n = int(input())
a = [int(i) for i in input().split()]
mod = 998244353
res = 0
for i in a:
	res += ft(i) % mod * n % mod
	res += st(i) % mod * n % mod
print(res % mod)


N = int(input())
nums = [int(x) for x in input().split()]
res = int()
for x in nums:
	s = str(x)
	s2 = str()
	for char in s:
		s2 += char + char
	res = res + int(s2)
res *= N
print(res % 998244353)


n = int(input())
sum = 0
line = input().split()
for i in range(0, n):
	n1 = ''
	n2 = ''
	for ch in list(line[i]):
		n1 = n1 + '0' + ch
		n2 = n2 + ch + '0'
	sum = sum + int(n1) + int(n2)
	sum %= 998244353
sum = sum * n % 998244353
print(sum)


import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
	return int(input())

def getList():
	return list(map(int, input().split()))
import math
MOD = 998244353
n = getN()
nums = getList()
nums.sort()
digits = len(str(nums[0]))
ans = 0

def anaaki(nstr):
	res = 0
	for (i, s) in enumerate(nstr[::-1]):
		res += int(s) * 10 ** (i * 2)
	return res
for (idx, num) in enumerate(nums):
	nstr = str(num)
	ret = anaaki(nstr) % MOD
	ans += ret * 11 * n
	ans = ans % MOD
print(ans)


import sys
import math
from math import *
import builtins
import collections
input = sys.stdin.readline

def print(x, end='\n'):
	sys.stdout.write(str(x) + end)

def get_int():
	return int(input())

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

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

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

def print_iterable(p):
	print(' '.join(map(str, p)))

def CountFrequency(arr):
	return collections.Counter(arr)

def reverse(s):
	l = len(s)
	for i in range(l // 2):
		(s[i], s[l - i - 1]) = (s[l - i - 1], s[i])
	return s

def binary_search(arr, x):
	low = 0
	high = len(arr) - 1
	mid = 0
	while low <= high:
		mid = (high + low) // 2
		if arr[mid] < x:
			low = mid + 1
		elif arr[mid] > x:
			high = mid - 1
		else:
			return mid
	return high

def pow(a, n):
	if n == 0:
		return 1
	elif n % 2 == 0:
		return pow(a, n // 2) % const * (pow(a, n // 2) % const) % const
	else:
		return pow(a, n // 2) % const * (pow(a, n // 2) % const) * (a % const) % const
global const
const = 998244353

def funop(n):
	if n == 0:
		return 0
	else:
		count = 0
		ans = 0
		while n > 0:
			ans += (10 ** (count + 1) * (n % 10) + 10 ** count * (n % 10)) % const
			n = n // 10
			count += 2
		return ans

def main():
	n = get_int()
	list = get_list_ints()
	ans = 0
	for i in range(n):
		ans += funop(list[i])
	ans = ans % const
	print(ans * n % const)
	pass
main()


M = 998244353
n = int(input())
a = [int(x) for x in input().split()]
from math import log
ans = 0

def op(n):
	out = 0
	if n == 0:
		return 0
	d = int(log(n, 10)) + 1
	for i in range(d + 1):
		out += 11 * 10 ** (2 * i) * (n % 10) % M
		n //= 10
	return out
for ai in a:
	ans += n * op(ai) % M
	ans %= M
print(ans)


n = int(input())
a = list(map(int, input().split()))
b = []
sum1 = 0
for i in range(n):
	t = a[i]
	s = ' '
	c = []
	while t > 0:
		x = t % 10
		c.append(x)
		c.append(x)
		t = t // 10
	ans = 0
	c.reverse()
	for j in c:
		ans = ans * 10 + j
	sum1 += ans
sum1 = sum1 * n
sum1 %= 998244353
print(sum1)


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

def getDigits(num):
	res = []
	while num:
		res.append(num % 10)
		num //= 10
	return res
a = list(map(getDigits, a))
ret = 0
for digits in a:
	p = 0
	for (i, d) in enumerate(digits):
		ret += (10 ** p * d + 10 ** (p + 1) * d) * n
		ret %= MOD
		p += 2
print(ret)


nm = int(input())
ln = [int(i) for i in input().split(' ')]
sm = 0
for i in range(0, len(ln)):
	n = list(str(ln[i]))[::-1]
	for j in range(0, len(n)):
		sm = (sm + int(n[j]) * 10 ** (j * 2) * nm) % 998244353
		sm = (sm + int(n[j]) * 10 ** (j * 2 + 1) * nm) % 998244353
print(sm)


n = int(input())
kq = 0
MOD = 998244353
st = input().split()
for s in st:
	x = 0
	for si in s:
		x = x * 10 + int(si)
		x = x * 10 + int(si)
	kq = (kq + x) % MOD
kq = kq * n % MOD
print(kq)


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 collections import Counter
import heapq
n = int(input())
import heapq
ans = 0
m = 998244353
arr = list(map(int, input().split()))
for i in range(n):
	var = ''
	c = str(arr[i])
	for i in c:
		var += str(i) * 2
	var = int(var)
	ans += n * var % 998244353
print(ans % 998244353)


from sys import *
from math import *
mod = 998244353
n = int(stdin.readline())
a = list(input().split())
b = []
for i in range(n):
	s = list(map(int, a[i]))
	x = 0
	for j in s:
		x *= 10
		x += j
		x %= mod
		x *= 10
		x += j
		x %= mod
	b.append(x)
ans = sum(b) * n % mod
print(ans)


def f(s1, s2):
	p = len(s1)
	q = len(s2)
	if p == q:
		s = ''
		for i in range(p):
			s += s1[i]
			s += s2[i]
		return s
	if p > q:
		return s1[:p - q] + f(s1[p - q:], s2)
	else:
		return s2[:q - p] + f(s1, s2[q - p:])
n = int(input())
A = list(map(str, input().split()))
ans = 0
for i in range(n):
	ans = (ans + int(f(A[i], A[i]))) % 998244353
print(n * ans % 998244353)


n = int(input())
s = [int(i) for i in input().split()]
ans = 0
for i in range(n):
	c = 0
	while s[i] != 0:
		d = s[i] % 10
		s[i] //= 10
		ans += d * 11 * 10 ** c * n
		c += 2
		ans %= 998244353
print(ans)


mod = 998244353
n = int(input())
print(sum(list(map(lambda x: int('0'.join(list(x))), input().split()))) * 11 * n % mod)


n = int(input())
l = list(map(int, input().split()))
ans = 0
for elem in l:
	nn = 0
	ln = len(str(elem))
	for i in range(ln):
		nn += elem // 10 ** (ln - i - 1) % 10 * 11 * 10 ** ((ln - i - 1) * 2)
	ans += nn * n
print(ans % 998244353)


n = int(input())
L = list(map(int, input().split()))
sum = 0
for k in L:
	count = 0
	while k != 0:
		x = k % 10
		k = k // 10
		sum += n * x * 11 * 10 ** (count * 2)
		count += 1
print(sum % 998244353)


n = int(input())
a = [int(x) for x in input().split()]
ans = int(0)
m = 998244353
for i in range(n):
	d = str(a[i])
	s = ''
	t = ''
	x = len(d)
	for j in range(x):
		t += '0'
		t += d[j]
	for j in range(x):
		s += d[j]
		s += '0'
	ans = (ans + int(t) * n + int(s) * n) % m
print(ans)


from sys import stdin, stdout
mod = 998244353
s = stdin.readline()
n = int(s)
s = stdin.readline()
a = list(map(int, s.split()))
sum = 0
for i in a:
	copy = i
	cur = 0
	while copy > 0:
		digit = copy % 10
		copy //= 10
		digit *= n
		sum += digit * pow(10, cur)
		cur += 1
		sum += digit * pow(10, cur)
		cur += 1
print(sum % mod)


mod = 998244353

def solve(todo):
	ret = 0
	cnt = 0
	while todo > 0:
		fir = sec = todo % 10
		todo = todo // 10
		tmp = (fir << 1) + (fir << 3) + sec
		ret = tmp * 100 ** cnt + ret
		cnt += 1
	return ret
tmp = input()
n = int(tmp)
arr = [int(x) for x in input().split(' ')]
ans = 0
for x in arr:
	ans = ans + solve(x) * n
ans %= mod
print(ans)


r = 0
n = int(input()) * 11
for a in input().split():
	m = n
	a = int(a)
	while a != 0:
		r += m * (a % 10)
		a //= 10
		m *= 100
print(r % 998244353)


n = int(input())
l = list(map(int, input().split(' ')))
s = 0
for a in l:
	p = 1
	while a > 0:
		d = a % 10
		s = s + 11 * p * d % 998244353
		s = s % 998244353
		p *= 100
		a //= 10
print(s * n % 998244353)


n = int(input())
a = list(map(int, input().split()))
M = 998244353
ans = 0
for i in range(n):
	j = 0
	while a[i] > 0:
		r = a[i] % 10
		ans = (ans % M + int(r * pow(10, j, M)) % M) % M
		j += 1
		ans = (ans % M + int(r * pow(10, j, M)) % M) % M
		a[i] //= 10
		j += 1
ans = ans * n % M
print(ans)


n = int(input())
a = list(input().split())
ans = 0
val = ''
for i in range(n):
	for alp in a[i]:
		val += alp * 2
	ans += n * int(val)
	val = ''
print(ans % 998244353)


n = int(input())
ans = 0
mod = 998244353
num = []
line = input()
for x in line.split():
	num.append(int(x))
for i in range(0, n):
	k = 1
	t = num[i]
	while int(t) > 0:
		ans = int(ans) + int(t % 10) * int(k) * int(n)
		ans = int(ans) % int(mod)
		ans = int(ans) + int(t % 10) * int(k) * int(n) * 10
		ans = int(ans) % int(mod)
		k = int(k * 100)
		t = int(t / 10)
ans = int(ans) % int(mod)
print(int(ans))


modulo = 998244353

def conv(x):
	res = 0
	for v in x:
		res = (res * 100 + int(v)) % modulo
	return res
n = int(input())
print(sum(map(conv, input().split())) * n * 11 % modulo)


from math import *
n = int(input())
mas = list(map(int, input().split()))
ans = 0
l = ''
v = ''
for i in range(n):
	l = str(mas[i])
	v = ''
	for j in range(len(l)):
		v = v + l[j] * 2
	ans = ans + int(v)
print(ans * n % 998244353)


import math as mt
import sys, string
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
from collections import defaultdict
n = I()
l = L()
ans = 0
for i in l:
	w = ''
	for j in str(i):
		w += j * 2
	w = int(w)
	ans += w * n % 998244353
	ans %= 998244353
print(ans)


query = int(input())
nos = input().split()
s = 0
for sin in nos:
	for i in range(len(sin)):
		s += query * 100 ** i * 11 * int(sin[len(sin) - 1 - i])
print(s % 998244353)


n = int(input())
s = input().split(' ')
ans = 0
MOD = 998244353
for t in s:
	a = ''
	for c in t:
		a += c
		a += c
	ans += n * int(a)
	ans %= MOD
print(ans)


import math as M
mod = 998244353

def f(a, b):
	x = ''
	s = str(a)
	for ele in s:
		x = x + ele
		x = x + '0'
	t = str(b)
	y = ''
	for ele in t:
		y = y + ele
		y = y + '0'
	y = int(y)
	y //= 10
	x = int(x)
	return x + y

def calculate(A, n):
	s = 0
	for i in range(n):
		s += f(A[i], A[i])
	return s * n
n = int(input())
A = list((int(i) for i in input().split()))
print(calculate(A, n) % mod)


n = int(input())
col = 0
m = 998244353
a = [int(el) for el in input().split()]
for i in range(n):
	s = str(a[i])
	x = len(s)
	res = ''
	for j in range(x):
		res += s[j]
		res += '0'
	con = 0
	for j in range(x * 2):
		con += int(res[j])
		con *= 10
	col += n * (con // 10) + n * (con // 100)
print(col % m)


import sys
input = lambda : sys.stdin.readline().strip('\r\n')
n = int(input())
a = list(map(int, input().split()))
for i in range(len(a)):
	s = []
	for j in range(len(str(a[i]))):
		s.append(str(a[i])[j])
		s.append(str(a[i])[j])
	a[i] = int(''.join(s))
print(n * sum(a) % 998244353)


from collections import Counter
n = int(input())
arr = [str(i) for i in input().split()]
p = 998244353
freq = [0 for i in range(10)]
for i in range(n):
	ll = len(arr[i])
	for j in range(ll):
		freq[ll - 1 - j] += int(arr[i][j])
		freq[ll - 1 - j] = freq[ll - 1 - j] % p
ans = 0
for i in range(10):
	x = freq[i] * pow(10, 2 * i, p)
	ans += x % p
	ans = ans % p
ans = ans * n % p
ans = ans * 11 % p
print(ans)


def c(a):
	s = ''
	for i in range(len(a)):
		s = s + a[i] * 2
	return int(s)
n = int(input())
ar = list(map(int, input().split()))
ans = 0
for i in range(n):
	ans = (ans + n * c(str(ar[i])) % 998244353) % 998244353
print(ans)


n = int(input())
ans = 0
mod = 998244353
li = input().split()
for i in li:
	t = 10
	for j in i[::-1]:
		ans += (ord(j) - ord('0')) * t * n
		ans += (ord(j) - ord('0')) * (t // 10) * n
		t *= 100
	ans %= mod
print(ans)


def f(x, y):
	x = str(x)
	y = str(y)
	n = ''
	for i in range(1, len(x) + 1):
		n += y[len(x) - i]
		n += x[len(x) - i]
	n = n[::-1]
	return int(n)

def space(x):
	x = str(x)
	newstring = ''
	for i in x:
		newstring += i
		newstring += '0'
	return int(newstring[:-1])
a = input()
b = input()
a = int(a)
b = b.split()
c = []
for i in b:
	c.append(int(i))
summer = 0
for i in c:
	summer += space(i) * a
	summer += space(i) * a * 10
print(summer % 998244353)


mod = 998244353

def count(s):
	sum = 0
	c = 1
	for i in s[::-1]:
		sum += int(i) * c
		c *= 100
	return sum
n = int(input())
a = input().split()
ss = 0
for i in a:
	ss += count(i) % mod
print(11 * n * ss % mod)


def func(a, n):
	temp1 = 0
	temp2 = 0
	powe = 10
	while a > 0:
		k = a % 10
		temp1 += powe * k
		temp2 += powe // 10 * k
		a //= 10
		powe *= 100
	return (temp1 % 998244353 * (n % 998244353) % 998244353 + temp2 % 998244353 * (n % 998244353) % 998244353) % 998244353
n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in range(n):
	ans += func(l[i], n)
	ans = ans % 998244353
print(ans)


def dig(n):
	a = 0
	while n:
		n = n // 10
		a += 1
	return a

def twoD(n):
	s = str(n)
	ss = ''
	for i in s:
		ss = ss + 2 * i
	return int(ss)
n = int(input())
MOD = 998244353
arr = [int(x) for x in input().split()]
k = dig(arr[0])
count = 0
for i in arr:
	t = twoD(i)
	count += n * t
	count = count % MOD
print(count)


import sys
input = sys.stdin.readline

def fu(a):
	s = 0
	j = 0
	for i in str(a)[::-1]:
		s += int(i) * 10 ** j
		j += 2
	return s % mod
mod = 998244353
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(n):
	s += fu(a[i]) * 11
	s = s % mod
print(s * n % mod)


n = int(input())
p = [0 for x in range(0, 20)]
q = str(input())
qq = q.split(' ')
for i in range(0, n):
	j = 1
	t = int(qq[i])
	while t != 0:
		p[j] += t % 10
		t //= 10
		j += 1
mod = 998244353
ans = 0
t = n
for i in range(1, 20):
	ans = (ans + p[i] * t) % mod
	t *= 10
	ans = (ans + p[i] * t) % mod
	t *= 10
print(ans)