Part a to problem 3 on io-gymnastics