#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  long long c;
  for (int i = 0; i < n; ++i) cin >> a[i];
  long long t = a[0];
  c = 0;
  while (t) {
    t = t / 10;
    ++c;
  }
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    long long f = 0;
    long long di[c];
    for (int j = 0; j < c; ++j) {
      di[j] = a[i] % 10;
      a[i] /= 10;
    }
    for (int j = c - 1; j >= 0; --j) {
      f = (f * 100 + di[j]) % mod;
    }
    f = (f * 11) % mod;
    sum = (sum + ((f % mod) * n) % mod) % mod;
  }
  cout << sum % mod;
  return 0;
}
