stdlib: fix new lines in writing. Add new lab4.rb