Finish A040 but not efficient
Solve A042 later