# Nonsense code to trace in order to gain a better understanding of the
# call stack, exactly what happens during function calls and returns, and
# how names are looked up.

N = 5
M = 2

def f(N):
    print('f before')
    x = M * g(N + 1)
    print('f after')
    return x

def g(N):
    print('g before')
    x = M * N
    print('g after')
    return x

def h(N):
    print('h before')
    x = f(g(N))
    print('h after')
    return x


if __name__ == '__main__':
    print(h(1))