Brainfuck, 205 bytes
++++++++++[-[<<+>>-]+<<]>,[<[-]-[>-<-----]>++[-[>>+<<-]>>]>+++[<<],>,]<[,>>---[> >]<<+++[<<]]>->>->>>>->>>>>>-[<[<<]<,++++++++++[.<]<++++[>++++++++<-]>[>]--[>>]< +[++[>+++++++++++<-]<+]>>[++.,>-.>]<[--<++]>] Formatted:
++++++++++ [ -[<<+>>-] +<< ] >, [ <[-] -[>-<-----] >++ [ -[>>+<<-] >> ] >+++[<<] ,>, ] < [ ,>>---[>>] <<+++[<<] ] >->>->>>>->>>>>>- [ <[<<] <,++++++++++[.<] <++++[>++++++++<-] >[>] --[>>] <+ [ ++[>+++++++++++<-] <+ ] >>[++.,>-.>] <[--<++] > ] Expects input without a trailing newline.