#include <bits/stdc++.h>
using namespace std;
const long double PI = 2 * acos(0.0);
void yes() { cout << "YES\n"; }
void no() {
  cout << "NO\n";
  cout << -1 << "\n";
  exit(0);
}
long long m(long long a) { return (a + 998244353) % 998244353; }
long long cel(long long x1, long long y1) {
  ;
  if ((x1 % y1) == 0) return x1 / y1;
  return x1 / y1 + 1;
}
long long power(long long a, long long b) {
  if (b == 0) return 1;
  long long d = power(a, b / 2);
  d = m(d * d);
  if (b & 1) d = m(d * a);
  return d;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> arr(n);
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long aa = arr[i];
    long long c = 0;
    while (aa) {
      ans += m((aa % 10) * power(10, c));
      aa /= 10;
      c += 2;
    }
  }
  ans = m(ans * 11);
  ans = m(ans * n);
  cout << ans;
  return 0;
}
