Asteroid Size Estimator
A scientific research team is trying to study asteroids sizes in the space to assess the impact of collision on earth. It is not possible size of the asteroid. Hence, they provided the relation of one asteroid size with another one. Given the relative size comparisons in equation, your task is to come up with a program which generates an output with relationship with all the asteroids found. Arrange size in descending order.
Develop a program to help the research team convert the input specification to standardized output specification. Your program is the relations data as input and produce an output as per corresponding output specification as output.
Please note: Custom input option is not available for this question.
Sample Input# 1:
code in java or c++