#Golfscript, <s>22</s> 21 bytes [Try it online!][1] *-1 byte thanks to careful final redefining of the `n` built-in.* {.n>{}{' '\}if:n}%:n; Explanation (with a slightly different version): {.n>{}{"\n"\}if:n}%:n; # Full program { }% # Go through every character in the string .n> if # If ASCII code is greater than previous... # (n means newline by default, so 1st char guaranteed to fit) {} # Do nothing {"\n"\} # Else, put newline before character :n # Redefine n as the last used character :n; # The stack contents are printed at end of execution # Literally followed by the variable n, usually newline # So because n is by now an ASCII code... # ...redefine n as the new string, and empty the stack [1]:http://golfscript.apphb.com/?c=OyJDT0RFR09MRiIKey5uPnt9eycKJ1x9aWY6bn0lOm47