#pragma GCC optimize("O3") #ifdef LOCAL #include "algo/debug_ver3.hpp" #else #define debug(...) #define debugArr(...) #endif #include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); long long const MOD = 998'244'353; int n; cin >> n; vector a(n); for (int i = 0; i < n; ++i) cin >> a[i]; sort(a.begin(), a.end()); long long x = 0; for (int i = 0; i < n; ++i) x = (10 * x % MOD + a[i]) % MOD; cout << x << '\n'; }