Full Question
What happened to those who committed a mortal sin before the sacrament of confession was instituted?
Answer
They would have needed perfect contrition for their souls to be cleansed of mortal sin. Perfect contrition is having sorrow over sins that is motivated by love for God rather than the fear of punishment only. Since God is both perfectly merciful and perfectly just, they could still obtain the forgiveness of sins and the purification of the soul.