#include <bits/stdc++.h>
using namespace std;
long long funtion_A(int A) {
  long long ans = 0, tmp = 1;
  while (A) {
    ans = ans + (A % 10 * tmp);
    A = A / 10;
    tmp = tmp * 100;
  }
  return ans % 998244353;
}
int main() {
  int n, key;
  scanf("%d", &n);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &key);
    ans = (ans + funtion_A(key) * n * 11) % 998244353;
  }
  printf("%lld\n", ans);
}
