A new study from Concordia University in Montreal has linked students who have occasional bad feelings to better overall grades.

The students who were mostly happy during their four years of university, and also experienced occasional negative moods, had the highest GPAs at the time of graduation.

“If you're generally happy, negative emotions can be motivating.” said study author Erin Barker, according to Medical XPress.

To reach these findings, researchers studied 187 first-year students at a large university and tracked their academic progress and emotional state through questionnaires over four years of school.

Read: Genes Are Pretty Important To Academic Success, But Changing The Learning Environment Could Help Those Who Fall Behind

Results showed that both negative and positive emotions play a role in our successes.

"We looked at students' response patterns to better understand how experiences of positive and negative emotions occurred over time. We then combined average patterns to look how each person varied from their own average and examined different combinations of trait and state affects together," Barker explained.

"This allowed us to identify the pattern associated with the greatest academic success: those who were happy for the most part, but who also showed bouts of elevated negative moods,” she added.

Previous studies have also linked better grades to exercise.

Medical Daily reported that there has been a connection between exercise and the size of the brain in 9 and 10- year-old children. MRI techniques showed that physically active kids had bigger hippocampi compared to their less active peers and did better in memory tests.

Source: Barker ET, Howard AL, Galambos NL, Wrosch C. Tracking Affect and Academic Success across University: Happy Students Benefit from Bouts of Negative Mood. Developmental Psychology. 2016.

Read more:

Music Education Improves Students' Academic Performance, But Active Participation Is Required

How A Healthy Breakfast In The Classroom Impacts Childhood Obesity And Academic Performance