@@ -0,0 +1,1137 @@
+import sys%0Aimport itertools%0A%0Awith open(sys.argv%5B1%5D, 'r') as test_cases:%0A    #GET THE FILE%0A    for test in test_cases:%0A        #ITERATION OVER ALL LINES%0A        stringe = test.strip()%0A        #MAKE A VARIABLE EQUAL TO THE LINE AT THE ITERATION%0A        list1 = %5Bint(i) for i in stringe.split(%22;%22)%5B0%5D.split(%22,%22)%5D%0A        # stringe.split(%22;%22)%5B0%5D EQUALS TO THE LIST OF NUMBERS NEEDED TO SOLVE THE PROBLEM%0A        #.split(%22,%22) TO SAVE ALL NUMBERS IN A LIST OF STRINGS%0A        #%5Bint(i) for i in stringe.split(%22;%22)%5B0%5D.split(%22,%22)%5D CREATE A LIST PARSING ALL STRINGS IN THE LAST LIST TO INTEGERS%0A        list2=%5B%5D%0A        #EMPTY LIST FOR SAVING REVERSED SUB LISTS%0A        howmany = int(stringe.split(%22;%22)%5B1%5D)%0A        #GET THE LAST ITEM IN THE test VARIABLE, THIS IS THE LENGTH OF THE SUBSTRINGS TO CREATE%0A        for i in range(0,len(list1),howmany):%0A            mini = list(list1%5Bi:howmany+i%5D)%5B::-1%5D%0A            if len(mini) == howmany:%0A                list2.append(mini)%0A            else:%0A                list2.append(list(list1%5Bi::%5D))%0A        total = %5Bstr(i) for i in (list(itertools.chain.from_iterable(list2)))%5D%0A        print (%22,%22.join(total))%0A

Create Reverse_Groups.py