#!/usr/local/bin/python2 def a(x): return x - 1 def b(x): return x * 9 def c(x): return x + 2 print reduce(lambda x, y: y(x), [a, b, c], 3)