<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def apply(funcs, stack):
  '''Apply functions to the stack, passing the resulting stack to next state.'''
  return reduce(lambda x, y: y(x), funcs, stack)