Problem 24: Very ugly but works(only for combinations of 10 things).