#include <bits/stdc++.h>
using namespace std;
int ans, n, mod = 998244353;
int main() {
  long long i, res, temp, x;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    temp = 1;
    res = 0;
    while (x > 0) {
      res = (res + (x % 10) * 11 * temp) % mod;
      x /= 10;
      temp = (temp * 100) % mod;
    }
    ans = (ans + res * n) % mod;
  }
  cout << ans % mod << endl;
}
