We consider the cubic Szeg\"o equation i u_t=Pi(|u|^2u) in the Hardy space on
the upper half-plane, where Pi is the Szeg\"o projector on positive
frequencies. It is a model for totally non-dispersive evolution equations and
is completely integrable in the sense that it admits a Lax pair. We find an
explicit formula for solutions of the Szeg\"o equation. As an application, we
prove soliton resolution in H^s for all s>0, for generic data. As for
non-generic data, we construct an example for which soliton resolution holds
only in H^s, 0<s<1/2, while the high Sobolev norms grow to infinity over time,
i.e. \lim_{t\to\pm\infty}|u(t)|_{H^s}=\infty if s>1/2. As a second application,
we construct explicit generalized action-angle coordinates by solving the
inverse problem for the Hankel operator H_u appearing in the Lax pair. In
particular, we show that the trajectories of the Szeg\"o equation with generic
data are spirals around Lagrangian toroidal cylinders T^N \times R^N.Comment: Small modifications in the proof of Proposition 1.3, changed the
order in the proof of Theorem 1.9, replaced the proof of \chi proper mapping
in Theorem 1.