def dec2hexs(n):
    """
    converts an integer to a hexadecimal string
    """
    s = ''
    while n > 15:
        s = "0123456789ABCDEF"[n % 16] + s
        n //= 16
    return "0123456789ABCDEF"[n] + s