local ffi = require("ffi") local C = ffi.C ffi.cdef[[ long long atoll(const char*); ]] local function lltonumber(str) return C.atoll(str) end local mod = 998244353 local n = io.read("*n", "*l") local str = io.read() local t = {} for w in str:gmatch("%d+") do table.insert(t, lltonumber(w)) end table.sort(t) local ans = 0LL for i = 1, n do ans = (ans * 10LL + t[i]) % mod end ans = tostring(ans):gsub("LL", "") print(ans)