#include <bits/stdc++.h>
using namespace std;
const int maxn = 100050;
const int mx = 1 << 17;
const int N = 105;
const int inf = 0x3f3f3f3f;
long long a[maxn];
const long long mod = 998244353;
int main() {
  long long n;
  scanf("%lld", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    long long x = a[i];
    long long p = 1;
    while (x) {
      long long tmp = x % 10;
      x /= 10;
      ans = (ans + tmp * p) % mod;
      ans = (ans + tmp * p * 10) % mod;
      p = (p * 100) % mod;
    }
  }
  printf("%lld\n", (ans * n) % mod);
}
