def ackermann(m, n):
    if m == 0:
        return n + 1
    elif m > 0 and n == 0:
        return ackermann(m-1, 1)
    elif m > 0 and n > 0:
        return ackermann(m-1, ackermann(m, n-1))
    
#print(ackermann(5, 6)) # RecursionError: maximum recursion depth exceeded in comparison
print(ackermann(3, 6))