/* Richard A. DeVenezia
 * Sep. 1992
 */

#include <stdio.h>

#define BytesInRow 20

main()
{

	char	c;
	int 	i=0, ii=0, j, jj=0;
	long    row=1;
	char    ch[BytesInRow];
	char*   s="0123456789ABCDEF";

	do /* always */
	{
		c = getchar();

		if (feof(stdin) != 0)
		  break;

		ch[i] = c;

		if (i==0)
		  fprintf( stdout, "%5d:%3d: ", row, jj);

		if (c < 0)
		  fprintf( stdout, "%h2x ", 256+c);
		else
		  fprintf( stdout, "%h2x ", c);

		i++;
		ii++;

		if (c==10) {
		  ii=i;
		  for (j=i;j<BytesInRow;j++) { i++; fprintf( stdout, "   "); }
		}

		if (i==BytesInRow) {
			for (j=0;j<ii;j++) { if (ch[j] >= 32) putchar (ch[j]); else putchar('.'); }
			putchar('\n');
			jj+=i;
			i=0;
			ii=0;
		}

		if (c==10) {
		  row++;
		  jj=0;
		}
	}
	while (1);

	putchar ('\n');
}
