#include <bits/stdc++.h>
using namespace std;
const long long P = 998244353LL;
const int N_MAX = 1e5 + 15;
int A[N_MAX];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  long long ans = 0LL;
  bool rem = 1;
  long long q = 1LL;
  while (rem) {
    long long t = 0LL;
    for (int i = 0; i < n; i++) {
      t += (1LL * (A[i] % 10));
      A[i] /= 10;
      if (A[i] == 0) rem = 0;
    }
    t *= q;
    t %= P;
    q *= 100LL;
    q %= P;
    ans += t;
    ans %= P;
  }
  ans *= 11LL;
  ans %= P;
  ans *= n;
  ans %= P;
  cout << ans << endl;
  return 0;
}
