solution of problem 1