print/./g?$&:$/for(reverse<>!~$",<>)x$'