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