<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_thumbpath(self, path, key, format):
 """Return the relative path of the thumbnail. path: path of the source image key: key of the thumbnail format: thumbnail file extension """

        relpath = os.path.dirname(path)
        thumbsdir = self.get_thumbsdir(path)
        name, _ = os.path.splitext(os.path.basename(path))
        name = '{}.{}.{}'.format(name, key, format.lower())
        return os.path.join(relpath, thumbsdir, name)