solve 24th problem