Hex input and output