I have to split the data into four groups and each split data into groups and subgroups like the following. How do I write this as a single for loop?
What I tried so