#include <bits/stdc++.h>
const int mod = 998244353;
using namespace std;
const int N = 1e5 + 10;
long long ch(long long t) {
  long long ans = 0, tmp = 1;
  while (t > 0) {
    int x = t % 10;
    ans = (ans + x * tmp) % mod;
    tmp = (tmp * 10) % mod;
    ans = (ans + x * tmp) % mod;
    tmp = (tmp * 10) % mod;
    t /= 10;
  }
  return ans;
}
void init() {
  long long t, ans = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &t);
    ans = (ans + ch(t)) % mod;
  }
  ans = (ans * n) % mod;
  cout << ans << endl;
}
int main() { init(); }
