We define the convolution of a cyclic spectrum by taking all strict positive differences of masses in the spectrum. The figure below shows the convolution of the theoretical spectrum of the cyclic peptide NQEL.

spectral convolution
Spectral convolution for the theoretical spectrum of NQEL. The most frequent elements in the convolution between 57 and 200 are (multiplicities in parentheses): 113 (8), 114 (8), 128 (8), 129 (8).

As predicted, some of the values in this figure appear more frequently than others. For example, 113 (the mass of L) appears eight times in the convolution of the theoretical spectrum of NQEL. We say that 113 has multiplicity 8. Six of the eight occurrences of 113 correspond to subpeptide pairs differing in an L: L and the empty peptide, LN and N, EL and E, LNQ and NQ, QEL and QE, NQEL and NQE.

Assignment

Write a function convolution that takes a cyclic spectrum $$s$$. The function must return the tuple of elements in the convolution of $$s$$ in decreasing order of their multiplicities. If an element has multiplicity $$k$$, it should appear exactly $$k$$ times.

Example

>>> convolution((0, 137, 186, 323))
(137, 137, 186, 186, 49, 323)