Solved in Python