In Berland each high school student is characterized byacademic performance — integer value between1 and 5.
In high school 0xFF there are two groups of pupils: the groupA and the group B. Each group consists of exactlyn students. An academic performance of each student is known — integer value between1 and 5.
The school director wants to redistribute students between groups so that each of the two groups has the same number of students whose academic performance is equal to1, the same number of students whose academic performance is2 and so on. In other words, the purpose of the school director is to change the composition of groups, so that for each value of academic performance the numbers of students in both groups are equal.
To achieve this, there is a plan to produce a series of exchanges of students between groups. During the single exchange the director selects one student from the class