def apply_auto(line, target, value):
    # type: (str, str, str) -> str
    """
    Replace the target string with the value in line
    """
    start_idx = line.find(target)
    if start_idx == -1:
        return line
    end_idx = start_idx + len(target)
    return line[:start_idx] + str(value) + line[end_idx:]