def deTokenize(separator, words, gaps):
    """deTokenize(separator, words, gaps) : reverse the work of the function tokenize(.). Returns a single sequence, where gaps are filled using separator.
    
    separator : a single value to be used to fill gaps
    words, gaps : lists of words and gap lengths, as returned by the function tokenize(.)
    """
    assert len(words) + 1 == len(gaps)
    seq=[]
    
    for i,w in enumerate(words):
      for j in range(gaps[i]):
        seq.append(separator)
      seq.extend(w)
    for j in range(gaps[-1]):
      seq.append(separator)
    
    if len(words) and isinstance(words[0], str):
      seq = "".join(seq)
    return seq