\documentclass{article}

\newsavebox\jjbox
\newlength\jjlen
\newcommand\xsjjkh[5]{
\savebox\jjbox{\phantom{$\displaystyle#2$}}
\settowidth\jjlen{\usebox\jjbox}
{\underbrace{#1#2}_{#4}}
\hspace{-\jjlen}
{\overbrace{\usebox\jjbox#3}^{#5}}
}

\begin{document}

\[\xsjjkh{a+b+}{c+d}{+e+f}{m}{n}\]

\[\xsjjkh{\frac12+\frac23+\cdots+}{\sum_{i=1}^{n}x_i}{+e+f}{m}{n}\]

\end{document}