The input file contains one or more test cases, each of them as described below.
The first line of the input will consist of one integer n indicating the number of events with 2 ≤ n ≤ 20. The second line will contain n integers, indicating the correct chronological order of n events. The remaining lines will each consist of n integers with each line representing a student's chronological ordering of the n events. All lines will contain n numbers in the range [1 . . . n], with each number appearing exactly once per line, and with each number separated from other numbers on the same line by one or more spaces.
For each test case, the output must follow the description below
For each student ranking of events your program should print the score for that ranking. There should be one line of output for each student ranking.
Warning: Read carefully the description and consider the difference between 'ordering' and 'ranking'.