Old solutions to tasks 1 to 3.