#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

uint8_t get_int(char c)
{
  if (c >= '0' && c <= '9') return      c - '0';
  if (c >= 'A' && c <= 'F') return 10 + c - 'A';
  if (c >= 'a' && c <= 'f') return 10 + c - 'a';
  return -1;
}

int main(void)
{
	char buff[33];
	size_t size;
	size_t i;
	uint8_t *output;
	
	fgets(buff, sizeof buff, stdin);
	size = strlen(buff) / 2;
	output = malloc(size);
	
	for (i= 0; i < size; ++i)
	  output[i] = get_int(buff[2*i]) * 16 + get_int(buff[2*i+1]);
	  
	for (i= 0; i < size; ++i)
		printf("%u ", output[i]);

	return 0;
}
