def mayorD(N, M=0):
    if N == 0:
        return M
    if N % 10 > M:
        M = N % 10
    return mayorD(N // 10, M)

print(mayorD(91))