  We obtain a generalization of the recent Kelley--Meka result on sets avoiding
arithmetic progressions of length three. In our proof we develop the theory of
the higher energies. Also, we discuss the case of longer arithmetic
progressions, as well as a general family of norms, which includes the higher
energies norms and Gowers norms.
