One more test is never in vain
My solution to the task
Sixth solution (unfinished)