package main import . "fmt" import . "slices" import . "os" import bf "bufio" func main() { rd:=bf.NewReader(Stdin) var n int Fscan(rd,&n) a:=make([]int64,n) for i:=range a { Fscan(rd,&a[i]) } Sort(a) var x int64 const m=998244353 for _,v:=range a { x=x*10%m+v%m x%=m } Println(x) }