<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __gen_coref_str(self, token_id, markable_id, target_id):
 """ generates the string that represents the markables and coreference chains that a token is part of. Parameters token_id : str the node ID of the token markable_id : str the node ID of the markable span target_id : int the ID of the target (either a singleton markable or a coreference chain) Returns ------- coref_str : str a string representing the token's position in a markable span and its membership in one (or more) coreference chains """

        span = self.markable2toks[markable_id]
        coref_str = str(target_id)
        if span.index(token_id) == 0:
            # token is the first element of a markable span
            coref_str = '(' + coref_str
        if span.index(token_id) == len(span)-1:
            # token is the last element of a markable span
            coref_str += ')'
        return coref_str