#include <bits/stdc++.h>
using namespace std;
vector<bool> sieve(long long n) {
  vector<bool> prime(n + 1, true);
  prime[0] = prime[1] = false;
  for (long long i = 2; i <= n; ++i) {
    if (prime[i] && (i * i) <= n)
      for (long long j = i * i; j <= n; j += i) prime[j] = false;
  }
  return prime;
}
long long power(long long a, long long b, long long m = 1000000007) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  vector<string> b(n);
  for (long long i = 0; i < n; ++i) {
    stringstream s;
    s << a[i];
    b[i] = s.str();
  }
  long long res = 0;
  for (long long i = 0; i < n; ++i) {
    stringstream x(b[i]);
    long long val;
    x >> val;
    val %= 998244353;
    long long temp = 0;
    for (long long j = 0; j < b[i].size(); ++j) {
      long long r = b[i][j] - '0';
      temp = temp * 10 + r;
      temp = temp * 10 + r;
      temp %= 998244353;
      val /= 10;
    }
    temp = (temp * n) % 998244353;
    res = (res + temp) % 998244353;
  }
  cout << res;
  return 0;
}
