def base10toN(num, base):
    """Convert a decimal number (base-10) to a number of any base/radix from 2-36."""

    digits = "0123456789abcdefghijklmnopqrstuvwxyz"

    if num == 0:
        return '0'

    if num < 0:
        return '-' + base10toN((-1) * num, base)

    left = num // base
    if left == 0:
        return digits[num % base]
    else:
        return base10toN(left, base) + digits[num % base]