def configs_to_str(configs):
    """Converts a set of Configurations to a str. The inverse of str_to_configs."""
    if len(configs) == 0:
        return ""
    if len(configs) == 1:
        [config] = configs
        return ','.join(map(str, config))
    strings = []
    for config in sorted(configs):
        if len(config) == 1:
            [store] = config
            strings.append(str(store))
        else:
            strings.append('(' + ','.join(map(str, config)) + ')')
    return '{' + ','.join(strings) + '}'