/* Trim trailing whitespace from text. */

#include <stdio.h>
#include <string.h>
#include <ctype.h>

main()
{
	char s[256];
	char *x;

	while (NULL != gets(s)) {
		for (x = s + strlen(s) - 1; (x >= s) && (isspace(*x)); x--) {
			*x = '\0';
		}
		puts(s);
	}
	return 0;
}
