#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int dir[4][2] = {-1, 0, 1, 0, 0, -1, 0, 1};
const int maxn = 1e5 + 5;
long long n;
long long mo = 998244353;
int main() {
  scanf("%lld", &n);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    long long a;
    scanf("%lld", &a);
    long long t1 = 1, t2 = 10;
    while (a) {
      long long b = a % 10;
      ans += b * (t1 + t2) % mo * n % mo;
      ans %= mo;
      t1 *= 100;
      t1 %= mo;
      t2 *= 100;
      t2 %= mo;
      a /= 10;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
