Issue: The decree issued on October 28, 2009 reorganized the initial year of health studies by combining four medical study tracks (medicine, odontology, pharmacy, midwifery) in a single year.Acompetitive examination leads to a specific ranking per track and per student. The selection of students must take into account the ranking as well as student preferences in each track. Objective: An algorithm derived from the Gale and Shapley stability of marriage problem helps carry out this operation optimally and indisputably. The Pierre et Marie Curie school of medicine developed the ResExam software, accessible over internet, that allows students to state their preferences, assigns student rankings in their tracks and eliminates tie scores. Results: ResExam is a generic software product that can be suited to any number of students and options (tracks, training courses, etc.). It ran successfully for the 2090 students who passed the competitive examination in May 2011. Other schools of medicine could easily benefit from it.