solution for 3A