The official Olympic Games creed enshrines what we’re always told about sport: “The most important thing in the Olympic Games is not to win but to take part”.

It’s a laudable statement, and there’s been plenty of amazing moments in Rio that have shown the best of the Olympic spirit.

But even the purest followers of those words will admit this: winning sure feels a lot better than losing. Here’s a round-up of some of those moments of ecstasy and agony at Rio 2016.

Cyclist Elia Viviani was on a high after taking gold in the men’s omnium…

(Victor R. Caivano/AP)

…but Serena Williams couldn’t hide her disappointment at sliding to a third round tennis singles defeat.

(Charles Krupa/AP)

Australia’s women’s rugby sevens team showed the pure joy of success as they claimed gold…

(Themba Hadebe/AP)

…but Team GB’s Jasmine Joyce and Emily Scott were dejected after missing out in their bronze medal match.

(David Davies/PA)

Some Olympians experience both ends of the spectrum, like Germany’s women’s hockey team during their quarter-final win against the United States…

(Hussein Malla/AP)

…and then a few days later after losing to the Netherlands in a semi-final shootout.

(Dario Lopez-Mills/AP)

Italy roared their celebrations after securing a place in the women’s water polo final…

(Eduardo Verdugo/AP)

…while their Russian opponents couldn’t quite bear to look as the match slipped away.

(Sergei Grits/AP)

For every Adam Peaty delighting in record-breaking gold medal glory for Great Britain…

(Morry Gash/AP)

…there’s a Louis Smith after just being pipped to gold by his team-mate Max Whitlock.

(Owen Humphreys/PA)

We’ve seen some memorable celebration moments at the Rio Games:

(Matt Dunham/AP)

(Dmitri Lovetsky/AP)

(Marcio Jose Sanchez/AP)

But sometimes success can be pretty overwhelming and get the tears flowing too, as gymnastics silver medallist Aly Raisman, tennis champ Andy Murray, 1500m winner Faith Kipyegon and bronze medallist in the same race Jennifer Simpson showed.

(David Goldman/AP)

(Charles Krupa/AP)

(Markus Schreiber/AP)

(Lee Jin-man/AP)

There’s no shame in that – even the greatest of Olympians can get emotional, you know.

(David J. Phillip/AP)

There’s no doubting that Olympians give it their all in pursuit of that golden moment. But win or lose, they’re playing their part in inspiring the next generation of medal hopefuls. And that’s a pretty amazing legacy.