#include <stdio.h>
/*
* This program reads stdin and sums each row of chars,
* not including the final newline.  This has some humorous
* applications ...
*/

#define B 1000
unsigned char b[B+1];

main()
{	int c, i=0, sum=0;

	while ((c = getchar()) != EOF) {
		if (c == '\n') {
			b[i] = 0;
			printf("%9d %s\n",sum,b);
			i = sum = 0;
		} else {
			if (i<B) b[i++] = c;
			sum += (c & 0x00FF);
		}
	}
	exit(0);
}
