def get_latest_analysis_inputs(files):
    """Get input files for the latest analysis version number of each chip_well_barcode."""
    latest_analysis_inputs = []
    for chip_name, chip_well_barcode in files.items():
        for barcode, versions in chip_well_barcode.items():
            latest_version = sorted(versions.keys(), key=lambda x: int(x))[-1]
            latest_analysis_inputs.extend(versions[latest_version])
    return latest_analysis_inputs