#include <bits/stdc++.h>
using namespace std;
bool prime[1000050];
struct node {
  long long int x;
  long long int y;
};
vector<long long int> connected;
bool compare(node a, node b) { return a.x > b.x; }
void addEdge(vector<long long int> adj[], long long int u, long long int v) {
  adj[u].push_back(v);
  adj[v].push_back(u);
}
void DFSUtil(long long int u, vector<long long int> adj[],
             vector<bool> &visited) {
  visited[u] = true;
  connected.push_back(u);
  for (int i = 0; i < adj[u].size(); i++)
    if (visited[adj[u][i]] == false) {
      DFSUtil(adj[u][i], adj, visited);
    }
}
void DFS(vector<long long int> adj[], long long int V) {
  vector<bool> visited(V, false);
  for (int u = 0; u < V; u++)
    if (visited[u] == false) DFSUtil(u, adj, visited);
}
void PG(vector<long long int> adj[], long long int V) {
  for (int i = 0; i < V; i++) {
    cout << i << ": ";
    for (int j = 0; j < adj[i].size(); j++) {
      cout << adj[i][j] << " ";
    }
    cout << endl;
  }
}
bool isPerfectSquare(double x) {
  double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
long long int sumofdigits(long long int n) {
  long long int sum = 0;
  while (n > 0) {
    sum++;
    n /= 10;
  }
  return sum;
}
void bfs(vector<int> adj[], long long int u, vector<int> &distances) {
  queue<int> q;
  q.push(u);
  long long int ans;
  long long int neighbor;
  while (q.empty() == false) {
    int f = q.front();
    q.pop();
    for (int i = 0; i < adj[f].size(); i++) {
      neighbor = adj[f][i];
      if (distances[neighbor] == -1) {
        q.push(neighbor);
        distances[neighbor] = distances[f] + 1;
      }
    }
  }
}
int powprime(long long int n, long long int factor) {
  int j = 0;
  while (n % factor == 0) {
    n = n / factor;
    j++;
  }
  return j;
}
long long int llipow(long long int n, long long int factor) {
  long long int ans = 1;
  for (long long int j = 0; j < factor; j++) ans = ans * n;
  return ans;
}
long long int arr[2500000];
long long int h1[200000];
long long int h2[200000];
long long int dp1[200000];
long long int dp2[200000];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int q;
  q = 1;
  for (int t = 0; t < q; t++) {
    long long int n;
    cin >> n;
    for (long long int i = 0; i < n; i++) cin >> arr[i];
    long long int indisum = 0;
    long long int sum = 0;
    for (long long int i = 0; i < n; i++) {
      long long int temp = arr[i];
      long long int mask = 1;
      indisum = 0;
      while (temp > 0) {
        indisum =
            indisum % 998244353 + (temp % 10) * (mask % 998244353) % 998244353;
        temp = temp / 10;
        mask = (mask % 998244353 * 100) % 998244353;
      }
      sum += (indisum % 998244353 * 11 * n) % 998244353;
    }
    cout << sum % 998244353;
  }
}
