When parents separate or divorce, they often wonder what’s best for their young children: should they spend more time with their mother in order to maintain a strong relationship? Or, should time be split equally?

A new study may offer the answer. Researchers found that children of divorce benefited from spending time, including sleeping over, at both parent’s homes.

And the adult children who went on to have the best relationships with their parents were the ones who spent equal time at both their mother’s home and their father’s home when they were very young, according to the study, published today (Feb. 2) in the journal Psychology, Public Policy and Law. [25 Scientific Tips for Raising Happy (and Healthy) Kids

Previous research suggested that when a child spends too much time with his or her father early in life, it can damage the mother-child bond, which had been viewed as the more important relationship, the researchers wrote in the study.

However, the researchers found that “not only did overnight parenting time with fathers during infancy and toddlerhood cause no harm to the mother-child relationship, it actually appeared to benefit children’s relationships with both their mothers and their fathers,” lead study author William Fabricius, an associate professor of psychology at Arizona State University, said in a statement.

The researchers included more than 100 college students in the study whose parents had separated or divorced before the student was 3 years old. These students were asked to assess their current relationships with each of their parents.

In addition, the researchers surveyed each student’s parents, asking them to report the amount of time the student spent as a young child with either the mother or the father. The parents also reported the amount of time the child spent with the father from ages 5 to 10 and from ages 10 to 15, according to the study. Finally, the parents noted whether they were separated or divorced for one, two or three of their child’s first three years, the researchers wrote.

The scientists found that the more overnight parenting time that the students had as infants and toddlers, up to and including equal time spent with the mother and father, the better their current relationships with their parents were.

The time spent with both parents at age 2 was particularly important, the researchers wrote. If a 2-year- old missed out on spending the night at both parents’ houses, the parents couldn’t compensate later with more overnight time, according to the study. The researchers noted that these particular overnight visits had a positive effect on the parent-child relationship regardless of any conflicts or disagreements between the mother and father about the overnights.

In other words, the findings were the same whether the parents agreed on equal time or not.

The researchers offered several reasons for why equal time with both parents is beneficial.

For the fathers, “having to care for their infants and toddlers for the whole cycle of evening, bedtime, nighttime and morning helps dads learn to parent their children from the beginning,” Fabricius said. “It helps dads and babies learn about each other, and provides a foundation for their future relationship,” he said.

For the mothers, letting the child spend the night with his or her father could offer a break from the stress of being a single mother, the researchers wrote.

Originally published on Live Science.