Solution for program