Time Limit: 1000MS
Memory Limit: 65535K
Give you N(0<N<=1000) groups of strings.Each group has 2 strings.Now you are required to sort these groups by the first string ascending order. If first strings are the same, then you should sort them by the second string descending order.The right order of strings is alphabetical.The length of one string will not be exceed 50.
To make it harder, I want you compute the Inverse number(Do not know it? Find it in Hint).
The Input consists of mulitiple cases.
In each case, the first line contains an integer N(0<N<=1000).
Then follows N lines. Each line contains two string. The strings consists of only English letters(case-sensitive).