import cProfile
import pstats

from day1 import day1
from day2 import day2
from day3 import day3
from day4 import day4
from day5 import day5
from day6 import day6
from day7 import day7
from day8 import day8
from day9 import day9
from day10 import day10
from day11 import day11
from day12 import day12
from day13 import day13
from day14 import day14
from day15 import day15
from day16 import day16
from day17 import day17


if __name__ == '__main__':
    days = [day1, day2, day3, day4, day5, day6, day7, day8, day9, day10, day11, day12, day13, day14, day15, day16, day17]

    for index, day in enumerate(days):
        pr = cProfile.Profile()
        solution = pr.runcall(day.calculate_solution)
        ps = pstats.Stats(pr)
        ps.sort_stats('cumulative')

        print("Result for day {} is: {}".format(index+1, solution))
        ps.print_stats()
        print('--------------------------------------------------')
