/*
 * I Ching:
 *              cno
 *
 * Reconstructed from pdp11 object file
 */

#include <stdio.h>

main()
{
	int     seed;

	if ((seed = question()) == 0)
		exit(0);
	srand(seed + time(0) + getpid() + getuid() + getgid());

	printf("%s\n", cno());
}

cno()
{
	static char     hexagram[8];
	int             toss, i;

	for (i = 0; i < 6; i++) {
		toss = rand() & 01;
		toss += rand() & 01;
		toss += rand() & 01;
		hexagram[i] = '6' + toss;
	}
	return(hexagram);
}

question()
{
	register int    c, sum;

	sum = 0;
	while ((c = getchar()) != EOF)
		sum += c;
	return(sum);
}
