Applicants are randomly assigned a rank. For each applicant, their school applications are sorted into two groups: schools inside their neighborhood and schools outside their neighborhood. First, for all applicants, only the schools inside their neighborhood are considered. Based on their rank number they are assigned a priority order for each of the schools they applied to. After all the priority orders are assigned for every school that is inside their neighborhood for all students, the same process is done for schools outside the neighborhood.
Note that it is possible for more priority orders to be assigned to a school than the number of vacant seats. In this case, if your priority order is less than or equal to the number of vacant seats, you are given a seat in that school. If your priority order is more than the number of vacant seats, then there is a possibility that you may be able to gain admission if people with higher priorities turn down their seats.