Energy spectra of TGE electrons and gamma rays reveal the charge structure of thunderclouds