You need to work out the logic before trying to write code.
What comparisons need to be made? The logic should use several if tests to determine the order of the values.