\documentclass{article}
\begin{document}
main before

\input{endinputinner.tex}

main after

\input{endinputinner2.tex}

main after 2
\end{document}