#include <bits/stdc++.h>
using namespace std;
const int M = 998244353;
long long k[20];
void kalk() {
  k[0] = 1;
  for (int i = 1; i < 20; i++) {
    k[i] = (k[i - 1] * 10) % M;
  }
}
long long f(long long a) {
  long long re = a;
  long long dig;
  int po = 0;
  long long result = 0;
  while (re != 0) {
    long long temp = 0;
    dig = re % 10;
    re = re / 10;
    temp = dig * k[po * 2];
    temp %= M;
    temp += dig * k[po * 2 + 1] % M;
    temp %= M;
    result += temp;
    result %= M;
    po++;
  }
  return result;
}
int main() {
  kalk();
  int n;
  cin >> n;
  long long result = 0;
  for (int i = 0; i < n; i++) {
    long long in;
    cin >> in;
    long long temp = f(in) * n % M;
    result += temp;
    result %= M;
  }
  cout << result << endl;
  return 0;
}
