Combinatorics of traces of Hecke operators