"But not to perish from internal distress and doubt when one inflicts great suffering and hears the cry of suffering : that is great, that belongs to greatness." The Gay Science, Fourth Book, 325
How can suffering being great be justified?
As the epigram to Joyous Science, Nietzsche quotes Emerson to the extent that (paraphrased):
For sages and poets, every experience (positive or negative) is profitable, all days sacred, all human beings “divine”.
Every interaction with the world is an encounter with it, and increases or decreases our powers, causes a change in the forces that contain and constitute our body and mind. If we are “ready” and have the right frame of mind — perhaps an ethicoaesthetic “evaluating” frame rather than a moralizing, interpreting one — we can be prepared for many kinds of events and unexpected encounters, able to turn accidents into opportunities.
More broadly the joyous science of poetry is a means of electrifying and intensifying the mystery of life, of feigning interest in order to produce fascination with life, to seduce us into believing in the value of life. To make meaning of our hardship, to create something beautiful and aesthetically justified from suffering: this is the long work of the poet or the sage, a self-guided conquest of the inner galaxies of the emotions, the chemistry of feelings; and in this sort of work we need every kind of experience (to have felt every point of view...)