#include <bits/stdc++.h>
using namespace std;
int n;
long long r, t, x, m = 0, ans, M = 998244353;
long long f(long long x) {
  return x ? (f(x / 10) * 100 + (x % 10) * 11) % M : 0;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    t = f(x);
    ans += t;
    ans %= M;
  }
  ans *= n;
  ans %= M;
  cout << ans << endl;
  return 0;
}
