replace puts print with \n