Input (grade 4): The first two were Buddhist Rajputs and the last two Hindu Brahmins.
Output (grade 5): The first two were Buddhist Rajputs, and the last two were Hindu Brahmins.