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