#include #include using namespace std; using namespace atcoder; typedef long long ll; void solve() { ll n; cin >> n; vector A(n); for (ll i = 0; i < n; ++i) cin >> A[i]; sort(A.begin(), A.end()); modint998244353 x = 0; for (ll i = 0; i < n; ++i) { x *= 10; x += A[i]; } cout << x.val() << endl; } int main() { solve(); return 0; }