#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
long long pwr(long long base, long power) {
  long long ans = 1;
  while (power) {
    ans = ((ans % mod) * (base % mod)) % mod;
    power--;
  }
  return ans % mod;
}
long long get1st(long long num) {
  long long i, sum, dig, tp;
  i = 0;
  sum = 0;
  while (num) {
    dig = num % 10;
    tp = ((pwr(10, i) % mod) * (dig % mod)) % mod;
    sum = ((sum % mod) + (tp % mod)) % mod;
    num /= 10;
    i += 2;
  }
  return sum % mod;
}
long long get2nd(long long num) {
  long long i, sum, dig, tp;
  i = 1;
  sum = 0;
  while (num) {
    dig = num % 10;
    tp = ((pwr(10, i) % mod) * (dig % mod)) % mod;
    sum = ((sum % mod) + (tp % mod)) % mod;
    num /= 10;
    i += 2;
  }
  return sum % mod;
}
int main() {
  long long n, i, tp1, tp2, sum = 0, a[110000];
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) {
    tp1 = ((n % mod) * (get1st(a[i])) % mod) % mod;
    tp2 = ((n % mod) * (get2nd(a[i])) % mod) % mod;
    sum = ((sum % mod) + (tp1 % mod)) % mod;
    sum = ((sum % mod) + (tp2 % mod)) % mod;
  }
  cout << sum << endl;
}
