There is a competition of strings. N strings have participated in the competition. Strings are ranked on the basis of its power. A smaller string has more power than a larger string. If two strings are of same size, then lexographically larger string has more power. Two same strings have the same power.
String A is lexicographically greater than a string B of the same length, if the strings are same up to some position, and then the string A has a larger character, than the string B.
Strings with larger power will have less rank. For e.g. - power of "ab" is more than the power of "abc" and so rank of "ab" will be 1 and rank of "abc" will be 2.
Strings will be ranked according to standard competition ranking. In standard competition ranking, items that compare equal receive the same ranking number, and then a gap is left in the ranking numbers. For e.g. - Given strings {"ab", "de", "de", "fg"}, ranks will be {4, 2, 2, 1}.
Given the strings, print the rank of each participant string.
See sample case for better understanding
Input format:
First line contains one integer n, denoting the number of strings.
Next n lines contains the participant strings containing lower case english alphabets.
Output format:
Print n integers, denoting ranks of each string.
Constraints:
1 <= n <= 100000(1e5)
1 <= length of strings <= 20
The strings will be ranked as : ab, ab, cdf, cde, cde, cde, abc, cdeg, with ranks as : 1, 1, 3, 4, 4, 4, 7, 8.