def output_group_name(group, pnr, settings):
    """
    Output <num><group_name> if it's a group PNR and has no paxes.
    Output <`unnamed seats number`><group_name> if free seats exists.

    Group contains total seats and some named seats.

    Example:

    `0.22SOTSZSHITA/GRP NM3 TE252`
    `1.CHURBANOV/STEPAN MR 2.DARENKOVA/MARINA MRS 3.EGOROV/NIKITA MR`
    """
    def no_paxes():
        """
        Order have no paxes.
        """
        return not pnr['name'] or len(pnr['name']) == 0


    def named_seats():
        """
        Returns named seats in group.
        """
        nseats = 0
        for pax in pnr['name']:
            nseats += pax.nseats

        return nseats


    if no_paxes():
        return group.total + group.name

    nseats = named_seats()

    if int(group.total) > nseats:
        return str(int(group.total) - nseats) + group.name

    return None