# include # include # include # include # include # include # include # include # include # include # include # include # include # define rep(i,a,b) for (int i=a; i using v = std::vector; lint mod = 998244353LL; using namespace std; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int n; cin >> n; v a(n); rep(i,0,n) cin >> a[i]; sort(all(a)); lint res = a[0]; rep(i,1,n) { res = (res*10LL + a[i])%mod; } cout << res << endl; return 0; }