# [CJam](http://sourceforge.net/projects/cjam/), 16 bytes

    l_,),.\'</Wf%'<*

[Try it online!](http://cjam.tryitonline.net/#code=bF8sKSwuXCc8L1dmJSc8Kg&input=PD48PD4-Pjw8)

A port of my Retina answer.