First reducer, which is working for small inputs (hamlet first 300 lines)