#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n;
int a[maxn];
const long long mod = 998244353;
int main() {
  cin >> n;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    long long cur = 0;
    for (int j = 0; j < s.length(); j++) {
      cur = cur * 100 + (s[j] - '0') * 11;
      cur %= mod;
    }
    (cur *= n) %= mod;
    (ans += cur) %= mod;
  }
  cout << ans << endl;
  return 0;
}
