#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const int N = 1e5 + 5;
long long a[N];
long long solve(long long x) {
  long long res = 0;
  long long index = 1;
  while (x) {
    long long r = x % 10LL;
    res = (res + index * 11LL % mod * r) % mod;
    x /= 10LL;
    index = index * 100LL % mod;
  }
  return res % mod;
}
int main() {
  int n;
  cin >> n;
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    ans = (ans + solve(a[i]));
  }
  cout << ans * n * 1LL % mod;
  return 0;
}
