Write and pretty print.