#include #define mod 998244353 using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector a(n); for(auto &nx : a){cin >> nx;} sort(a.begin(),a.end()); long long x=0; for(auto &nx : a){ x*=10; x%=mod; x+=nx; x%=mod; } cout << x << "\n"; return 0; }