President Gordon B. Hinckley gave mayors from around the nation an earful Friday about the need to instill children with strong moral values, thereby reducing problems of gangs, drugs and violence.

President Hinckley, president of The Church of Jesus Christ of Latter-day Saints, said teachers and, most especially, parents are the ones to instill those values."There is no adequate substitute for husband and wife, father and mother, working together to strengthen each other and guide the destinies of their children," he told about 50 mayors gathered at the Joseph Smith Memorial Building, in town for a U.S. Conference of Mayors meeting and youth violence summit.

Quoting statistics showing 23 percent of families in the United States with children under 18, 7.8 million, to be fatherless, President Hinckley repeated his call for fathers to lead their families in righteousness.

"The God of heaven designed the family as the basic unit of society," he said. "He did not design that children should be begotten and left to a single and often poor mother to rear. He designed that a father should stand as a pillar of strength in every household."

President Hinckley's call for individual and societal discipline, with schools teaching good values instead of ignoring them in the name of neutrality, fell on fertile ears, as the mayors had just completed a full day of figuring out what they could do to combat youth violence. Some of the measures the mayors intend to propose to President Clinton are school uniforms and stricter gun control laws.

"He didn't tell us anything that we didn't already know, but we have to be constantly reminded," said Charlotte Mayor Patrick McCrory.

While the mayors focused on short-term practical solutions, President Hinckley said he was advocating a long-term, permanent solution.

"To you men and women of great influence, you who preside in the cities of the nation, to you I say that it will cost far less to reform our schools to teach the virtues of good citizenship than it will to go on building and maintaining costly jails and prisons in which to warehouse the many who violate the law," he said.

Most important, President Hinckley said, was asking for God's help.

"I put father back as head of the family, and while doing so, I plead with him to institute and follow a practice which was commonplace in the homes of America a century ago. We have largely lost sight of it. That is the practice of prayer. Regardless of religious affiliation, a father who will kneel with his wife and children will do wonders for them. . . .

"What I have suggested may sound a little strange as I speak to you, the mayors of the cities of America. Am I getting into a field where I do not belong, when I take the liberty of suggesting to you able and concerned people that the time has come for the citizens of this land to acknowledge our failures and our weaknesses in dealing with some of these terrible problems and to get on our knees and seek the wisdom of heaven?"

He then answered his own question.

"The marvelous thing is that it works."