#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 10;
const long long mod = 998244353;
long long a[MAXN], b[MAXN];
long long i, j, k, h, n, m, p, q, ans, sum;
long long f(long long n) {
  int ans = 0;
  while (n) {
    a[ans] = n % 10;
    n /= 10;
    ans++;
  }
  long long sum = 0, ff = ans * 2 - 1, tt;
  for (long long i = ans - 1; i >= 0; i--) {
    tt = 1;
    for (long long j = 1; j <= ff; j++) tt = (tt * 10) % mod;
    sum = (sum + a[i] * tt) % mod;
    tt = 1;
    ff--;
    for (long long j = 1; j <= ff; j++) tt = tt * 10 % mod;
    sum = (sum + a[i] * tt) % mod;
    ff--;
  }
  return sum;
}
int main() {
  scanf("%lld", &n);
  long long s = 0;
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &b[i]);
    s = (s + (f(b[i]) % mod * n)) % mod;
  }
  printf("%lld\n", s);
}
