z-names
You want to keep names of all the people competing on z-training. For that Little Z will be giving you one name at the time. Each time little z gives you a name, you have to add that name to the list that is kept alphabetically sorted, and report how many people are before, and how many after that name on the list.
This task is not interactive, you can first read all the names, and then report all the numbers at the end
InputFrom the standard input read one integer N representing the number of names. 1 <= N <= 10000. From the next N lines read the names. Each names will consist of small letters of the English alphabet. All the names will be different and contain at most 30 characters
OutputTo the standard output write N lines, representing the total report. Each line should have two integers separated by space representing how many people were on the list above and below the corresponding name at the time it was added to the list
Input:
3
z
aleks
ioiOutput:0 0
0 1
1 1Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.