What LaTeX markup would one have to write to produce a result similar to the image below?

Please excuse my Paint-and-mouse drawing skills. :-)
What LaTeX markup would one have to write to produce a result similar to the image below?

Please excuse my Paint-and-mouse drawing skills. :-)
amsmath's \text can help to obtain the correct size of superscript/subscript fonts in math mode, while the bracing it possible using the traditional \overbrace/\underbrace:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
$\overbrace{a\rightarrow\underbrace{(b\rightarrow c)}_{\text{bar}}}^{\text{foo}}$
\end{document}
For other symbols (like arrows), see the Comprehensive LaTeX Symbol List.
While Werner's solution is compact and precise, this one shows other possibilities.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\overset{\text{foo}}{\overbrace{a\rightarrow \underset{\text{bar}}{\underbrace{(b \rightarrow c)}}}}
\]
\end{document}

However, I would go Werner's way if I have to do this :-). (This answer is for having some fun).
\tikzmarksolution... :-) – Peter Grill Oct 28 '12 at 01:27mathtoolspackage for fixing the spacing of the braces and introducing brackets together with many other fixes to amsmath package. Section 3.3.2 is the part I've mentioned. – percusse Oct 28 '12 at 09:46