In the decimal system, the position of a digit is used to signify the power of 10 that digit is to be multiplied with. For example, “314” denotes the number 3 × 100 + 1 × 10 + 4 × 1. Similarily, in the hexadecimal system, the position of a digit is used to signify the power of 16 that digit is to be multiplied with; therefore, “314” denotes the number 3 × 162 + 1 × 16 + 4 × 1.
Write a function that performs base conversion from decimal to hexadecimal. Specifically, the input is an integer, representing a decimal number; the output is a string representing the input in the hexadecimal system. Note that we use “A” to represent 10, “B” for 11, . . . , and “F” for 15 in the hexadecimal system.
Each line of the input contains an integer x, representing a decimal number. Input file is terminated by end of file.
For each line of input you will have to produce one line of output which is the hexadecimal representation of x.