def conv(num: int, b: int) ->str:
    """Convert number to base b. ~ inverse of int(num, b)
    """
    conv_str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    items = []
    while True:
        value = conv_str[num % b]
        items.append(value)
        num = num // b
        if num == 0:
            break
    return ''.join(sorted(items, reverse=True))
