/*   @JUDGE_ID:   1705PZ   10260   C */
#include <stdio.h>

main()
{
	int i, last, tmp;
	char w[21];
/*			a, b, c, d, e, f, g, h, i, j, k, l, m,	*/
	int s[26] =   { 0, 1, 2, 3, 0, 1, 2, 0, 0, 2, 2, 4, 5,
/*			n, o, p, q, r, s, t, u, v, w, x, y, z	*/
			5, 0, 1, 2, 6, 2, 3, 0, 1, 0, 2, 0, 2};

	while( scanf("%s", w) == 1 ) {
		last = -1;
		for(i = 0; w[i]; i++) {
			tmp = s[w[i] - 'A'];
			if( tmp != last && tmp != 0) {
				printf("%d", tmp);
			}
			last = tmp;
		}
		printf("\n");
	}
}
@END_OF_SOURCE_CODE
