I'd prefer a solution w/o any heap allocation as it is just for output purpose.
let me rework it.