(define (a f n)
  (lambda (x)
    (cond ((= n 0) x)
          (else (f ((a f (- n 1)) x))))))

((a (lambda (x) (* x x)) 3) 2)