#include #include using namespace std; using mint = atcoder::modint998244353; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int n; cin >> n; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); string s = ""; for (string t : a) { s += t; } mint ans = 0; for (char c : s) { ans = 10 * ans + (c - '0'); } cout << ans.val() << endl; }