This article deals with the studying of the interaction of gravity wav
es propagating on the surface of an ideal fluid of infinite depth. The
system of the corresponding equation is proven to be integrable up to
the fourth order in power of steepness of the waves, but to be nonint
egrable in the next, fifth, order. An exact formula for the five-wave
scattering matrix element is obtained using diagram technique on the r
esonant surface. The stationary solutions of the five-wave kinetic equ
ation are studied as well.