solution for problem17