Problem 5 for io-gymnastics