#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long mod = 998244353;
int n;
long long ans, a[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) {
    long long w = 1;
    while (a[i]) {
      long long t = a[i] % 10;
      ans = (ans + t * 11 % mod * w % mod) % mod;
      w = w * 100 % mod;
      a[i] /= 10;
    }
  }
  cout << ans * n % mod << endl;
}
