python/hexadecimal: First working solution