def to_base(num, b, numerals='0123456789abcdefghijklmnopqrstuvwxyz'):
    """
    Python implementation of number.toString(radix)
    Thanks to jellyfishtree from https://stackoverflow.com/a/2267428
    """
    return ((num == 0) and numerals[0]) or (to_base(num // b, b, numerals).lstrip(numerals[0]) + numerals[num % b])