#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long double eps = 1e-6;
const long long mod = 998244353;
const long long maxn = 1e5 + 1;
long long st[20];
long long get(long long x, long long s) {
  long long res = 0;
  while (x) {
    res = (res + (x % 10) * st[s]) % mod;
    s += 2;
    x /= 10;
  }
  return res;
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  st[0] = 1;
  for (long long i = 1; i < 20; ++i) {
    st[i] = (st[i - 1] * 10) % mod;
  }
  long long n;
  cin >> n;
  long long ans = 0;
  for (long long i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    ans = (ans + (get(x, 0) * n) % mod + (get(x, 1) * n) % mod) % mod;
  }
  cout << ans;
  return 0;
}
