def group_reference(string):
    """
    Group reference number to have space after every fifth number
    e.g. 1 23456
    :param string: input string
    :return: modified string
    """
    string = ''.join(string.split())
    return ''.join(e if (len(string) - i - 1) % 5 else e + " " for (i, e) in enumerate(string)).strip()