<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def findHierarchy(self, max_subs=10):
 """Find hierarchy for the LaTeX source. ('section', 'subsection') ('subsubsection', 'subsubsubsection') ('section', 'subsection') """

        hierarchy = []
        defaults = TOC.default_hierarchy + tuple(
            '%ssection' % ('sub'*i) for i in range(2, max_subs))
        for level in defaults:
            if getattr(self.source, level, False):
                hierarchy.append(level)
        return tuple(hierarchy)