Perhaps some of you guys may curious about the relationship between Fat Brother and Maze, why they always came up together? Well, in fact, they are childhood sweethearts; they studied in the same primary school, same middle school and same high school. Also, they always studied in the same class, what a coincidence!
But there is no magic in this world, the whole things are just because, L, a clever student who is in the same age as Fat Brother. He always helped teachers dividing students into the classes. Every time he did that, he would divide Fat Brother and Maze into the same class just because he knows that Fat Brother loves Maze.
But dividing students into classes is not an easy task, assume that there are 1000 students in a grade and they need to be divided into 20 classes. To make a good dividing, the follow conditions must be fulfilled.
1. For any two classes, the number of the students of them must be equal.
2. The number of the male students and the female students in each class must be equal.
3. For any two classes, the difference between the average score of the Literature could not be large than 0.12.
4. For any two classes, the difference between the average score of the Mathematics could not be large than 0.12.
5. For any two classes, the difference between the average score of the English could not be large than 0.12.
6. Fat Brother and Maze must be in the same class.
So now you know that L is Fat Brother’s best friend forever.
There is just one input with 1000 lines in the data case. Each line consists of 4 integers which indicate a student’s information. The first three integers represent this student’s Literature, Mathematics and English score (0 <= score <= 100) respectively. The forth integer represents this student’s gender, 0 for the male and 1 for the female. The first line of the data is Fat Brother’s information and the second line is Maze’s information. The number of the male students and the number of the female students are equal in the input data.
Output 1000 integers in one line, the ith integer represents the class that the ith student should be on. If your output fulfills all the requirements, you would pass the test data. It is guaranteed that there exists at least one correct answer.
60 90 1 0 100 100 100 1 45 66 34 1 22 44 95 1 34 9 84 0 94 83 9 1 29 85 9 0 48 96 81 0
1 1 2 4 3 3 2 4