def to_base_36(num):
    """Returns num, a base 10 integer, as a base 36 string.""" 
    b = 36
    numerals='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    return ((num == 0) and numerals[0]) or (to_base_36(num // b).lstrip(numerals[0]) + numerals[num % b])