#include <bits/stdc++.h>
using namespace std;
const unsigned long long LIMIT = 1e5, MOD = 998244353;
unsigned long long n, a;
unsigned long long r = 0;
unsigned long long fillZeros(unsigned long long x) {
  unsigned long long lX = 0;
  unsigned long long divider = 1;
  while (x) {
    unsigned long long c = x % 10;
    lX += (c * divider);
    x /= 10;
    divider *= 100;
  }
  return lX;
}
int main() {
  scanf("%lld", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a);
    unsigned long long lA = fillZeros(a);
    r = (r + lA) % MOD;
    r = (r + lA * 10LL) % MOD;
  }
  r = (r * n) % MOD;
  printf("%lld", r);
  return 0;
}
