Once you know how the body value and its model configuration correspond, you can define it's weapon and it's head by only specifying the body value.
What actually happens, is that first all combinations of the first body part are walked trough. For the grunts, these are their heads. Once all heads are walked through, the second body group switches to it's next option and the first body group is walked through again.
For the grunts, the second body group is their body, wich has only one option. No switching possible there, so the third group is being switched to the next and the first group is walked through again. Untill all possibilities are done...
HLMV is a very handy tool to find out what numbers would correspond with what configurations. Also note that the first configuration (what you see when you view a model in HLMV before changing it's body parts to other options) starts at value 0. Not at 1!