#!/usr/bin/env python3

import configparser
import io
import itertools
import sys

config = configparser.ConfigParser()
config.optionxform = str

# https://stackoverflow.com/a/24501036/288201
config.read_file(itertools.chain(['[global]'], sys.stdin))

if 'Groups/0' in config:
    config['Groups/0']['DefaultIM'] = config['Groups/0/Items/1']['Name']

output = io.StringIO()
config.write(output, space_around_delimiters=False)
contents = output.getvalue()
contents = contents.removeprefix('[global]\n').lstrip()
print(contents, end='')
