n = input()
a = map(int, raw_input().strip().split())

ans = 0
MOD = 998244353
MOD2 = MOD * MOD

for i in xrange(n):
    x = 0
    num = a[i]
    j = 0
    while num > 0:
        r = num % 10
        x += (r * pow(10, 2 * j + 1))
        num //= 10
        j += 1

    y = 0
    num = a[i]
    j = 0
    while num > 0:
        r = num % 10
        y += (r * pow(10, 2 * j))
        num //= 10
        j += 1

    ans += (x + y)
    if ans >= MOD2: ans %= MOD

ans = (ans * n) % MOD

print ans