ω Centauri, the largest globular cluster of the Milky Way, is composed of several stellar populations, which can be seen in both photometry and spectroscopy. The history of how these different populations assembled will allow us to reconstruct the evolution of this complex object. In particular, understanding the detailed chemical evolution will be particularly illuminating. However, this is not easy because of the errors intrinsic to abundance determinations. We performed a statistical cluster analysis on the large data set of accurate abundances recently provided for about 800 red giant branch stars. We find that stars in ω Cen divide into three main groups. The metal-poor group includes about a third of the total. It shows a moderate O-Na anticorrelation, and similar to other clusters, the O-poor second generation stars are more centrally concentrated than the O-rich first generation ones. This whole population is La-poor, with a pattern of abundances for n-capture elements that is very close to a scaled r-process one. The metal-intermediate group includes the majority of the cluster stars. This is a much more complex population, with an internal spread in the abundances of most elements. It shows an extreme O-Na anticorrelation, with a very numerous population of extremely O-poor and He-rich second generation stars. This second generation is very centrally concentrated. This whole population is La-rich, with a pattern of the abundances of n-capture elements that shows a strong contribution by the s-process. The spread in metallicity within this metal-intermediate population is not very large, and we can attribute it either to non-uniformities of an originally very extended star-forming region, or to some ability to retain a fraction of the ejecta of the core-collapse SNe that exploded first, or both. As previously noticed, the metal-rich group has an Na-O correlation rather than anticorrelation. There is evidence for the contribution of both massive stars ending their life as core-collapse SNe, and intermediate/low mass stars, producing the s-capture elements. Kinematics of this population suggests that it formed within the cluster rather than being accreted.