You just need a function that takes care of printing the data. The function must know what the individual parts of the classes means, so it's your job.
(Does not necessarily need to be part of any class, but can be.)