To remove a cognitive dissonance in interpersonal relations, people tend to divide their acquaintances into friendly and hostile parts, both groups internally friendly and mutually hostile. This process is modeled as an evolution toward the Heider balance. A set of differential equations have been proposed and validated (Kułakowski et al., 2005) to model the Heider dynamics of this social and psychological process. Here we generalize the model by including the initial asymmetry of the interpersonal relations and the direct reciprocity effect which removes this asymmetry. Our model is applied to the data on enmity and friendship in 37 school classes and 4 groups of teachers in México. For each class, a stable balanced partition is obtained into two groups. The gender structure of the groups reveals stronger gender segregation in younger classes, i.e. of age below 12 years, a fact consistent with other general empirical results.