Solves task for numbering lines