/*
 *	This is a filter to reverse the order of characters on each input line.
 */

#define MAXLINELEN 256		/* max number of printable chars per line */

main()
{
	char buf[MAXLINELEN];	/* line buffer */
	int i;			/* where to put the next input char in buf[] */
	int ch;			/* current input char under inspection */

	i = 0;

	while ((ch = getchar()) != EOF) {
		if (ch == '\n') {
			/* i indexes one past the last character */
			while (i>0) putchar(buf[--i]);	/* leaves i=0 */
			putchar('\n');
		} else {
			/* regular char - put it in the buffer */
			buf[i++] = ch;
		}
	}

	exit(0);
}
