def decode_pair(left: str, right: str, rep: int, s: str) -> str:
    """Decodes a left/right pair using temporary characters."""
    return (
        s.replace("", "")
        .replace("\ufffe" * rep, left)
        .replace("\uffff" * rep, right)
    )