func main() var n: int :: cui@inputInt() var a: []C :: #[n]C for i(0, n - 1) do a[i] :: (#C).init(cui@inputStr()) end for do a.sort() for i(0, n - 1) do cui@print("\{a[i]}\{i = n - 1 ?("\n", " ")}") end for class C() +var v: int +func init(s: []char): C switch(s[0]) case 'D' do me.v :: 100 case 'C' do me.v :: 200 case 'H' do me.v :: 300 case 'S' do me.v :: 400 end switch switch c(s[1]) case 'A' do me.v :+ 1 case 'T' do me.v :+ 10 case 'J' do me.v :+ 11 case 'Q' do me.v :+ 12 case 'K' do me.v :+ 13 default do me.v :+ c $ int - '0' $ int end switch ret me end func +*func cmp(t: kuin@Class): int ret me.v - (t $ C).v end func +*func toStr(): []char const s: []char :: " DCHS" const v: []char :: " A23456789TJQK" ret "\{s[me.v / 100]}\{v[me.v % 100]}" end func end class end func