The classification of transitions between levels of principal quantum numbers 3 and 4 in Fe IX to XVI and Mn VIII to XV