Write each class into a separate string