#include <bits/stdc++.h>
using namespace std;
string multiply(string num1, string num2) {
  long long n1 = num1.size();
  long long n2 = num2.size();
  if (n1 == 0 || n2 == 0) return "0";
  vector<long long> result(n1 + n2, 0);
  long long i_n1 = 0;
  long long i_n2 = 0;
  for (long long i = n1 - 1; i >= 0; i--) {
    long long carry = 0;
    long long n1 = num1[i] - '0';
    i_n2 = 0;
    for (long long j = n2 - 1; j >= 0; j--) {
      long long n2 = num2[j] - '0';
      long long sum = n1 * n2 + result[i_n1 + i_n2] + carry;
      carry = sum / 10;
      result[i_n1 + i_n2] = sum % 10;
      i_n2++;
    }
    if (carry > 0) result[i_n1 + i_n2] += carry;
    i_n1++;
  }
  long long i = result.size() - 1;
  while (i >= 0 && result[i] == 0) i--;
  if (i == -1) return "0";
  string s = "";
  while (i >= 0) s += std::to_string(result[i--]);
  return s;
}
long long modulo(string num, long long a) {
  long long res = 0;
  for (long long i = 0; i < num.length(); i++)
    res = (res * 10 + (long long)num[i] - '0') % a;
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n;
  cin >> n;
  long long arr[n];
  vector<string> v;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    string temp = to_string(arr[i]);
    v.push_back(temp);
  }
  long long num = 0;
  for (long long i = 0; i < n; i++) {
    string temp = v[i];
    string s = "", ss;
    for (long long j = 0; j < temp.size(); j++) {
      s += '0';
      s += temp[j];
    }
    ss = s + '0';
    num += (modulo(s, 998244353) * (n % 998244353)) % 998244353;
    num += (modulo(ss, 998244353) * (n % 998244353)) % 998244353;
    num = num % 998244353;
  }
  cout << num << endl;
}
