def int2base36(n):
    """
    Convert int base10 to base36.
    Back convert: int('<base36>', 36)
    """
    assert isinstance(n, (int, long))
    c = '0123456789abcdefghijklmnopqrstuvwxyz'
    if n < 0:
        return '-' + int2base36(-n)
    elif n < 36:
        return c[n]
    b36 = ''
    while n != 0:
        n, i = divmod(n, 36)
        b36 = c[i] + b36
    return b36