python solution for 13