solution for the first test 1870902