<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def root(self):
 """ Retrieves the root container. :rtype: :class:`Con`. """


        if not self.parent:
            return self

        con = self.parent

        while con.parent:
            con = con.parent

        return con