#include using namespace std; using ll = long long; using ld = long double; #ifdef LOCAL #include #else #define debug(...) void(0) #endif #include using namespace atcoder; using mint = modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector A(N); for(int i = 0; i < N; i++) cin >> A[i]; sort(A.begin(), A.end()); mint x = 0; for(int i = 0; i < N; i++) { x *= 10; x += A[i]; } cout << x.val() << endl; }