[lit] Use .write() methods instead of print statement.