<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apply_mtd(self, mtd, *args, cont=False, tag=None, **kwargs):
 """Call the method `mtd` on both sides of the equation That is, the left-hand-side and right-hand-side are replaced by:: lhs=lhs.<mtd>(*args, **kwargs) rhs=rhs.<mtd>(*args, **kwargs) The `cont` and `tag` parameters are as in :meth:`apply`. """

        new_lhs = getattr(self.lhs, mtd)(*args, **kwargs)
        if new_lhs == self.lhs and cont:
            new_lhs = None
        new_rhs = getattr(self.rhs, mtd)(*args, **kwargs)
        new_tag = tag
        return self._update(new_lhs, new_rhs, new_tag, cont)