import shutil


def concatenate_files(*paths: str, out_path: str):
    """Concatenates an arbitrary number of files into one file.

    Args:
        *paths: An arbitrary number of paths to files
        out_path: Path to place concatenated file

    Returns:
        Path to concatenated file
    """
    with open(out_path, 'wb') as out:
        for path in paths:
            with open(path, 'rb') as f:
                shutil.copyfileobj(f, out)

    return out_path