def filter_composite_from_subgroups(s):
    dims = []
    for letter, sg in zip('ABCDEFGHIJKLMNOPQRSTUVWZ', s[2:]):
        dims.append('dim{0}'.format(letter))
    if dims:
        return ' '.join(dims)