Harry is very disturbed by the fact that many people on the internet mix uppercase and lowercase letters within a single word. That's why he decided to invent an extension for his favorite browser that would change the letters in each word on a webpage so that each word either only consists of lowercase letters or only of uppercase ones. This change should be done in such a way that the least number of letters is modified. For example, the word HoUse
must be replaced with house
, and the word ViP
— with VIP
. If a word contains an equal number of uppercase and lowercase letters, you should replace all the letters with lowercase ones. For example, maTRIx
should be replaced by matrix
. Your task is to use the given method on one given word.
Input Format
The first line contains the number of test cases, .
For each test case, there is a line containing a word . This word consists of uppercase and lowercase Latin letters, and its length can range from to .
Sample Input
3
HoUse
ViP
maTRIx
Output Format
For each test case, print the corrected word . If the given word has strictly more uppercase letters, convert all the letters in the word to uppercase. Otherwise, make all letters lowercase.
Sample Output
house
VIP
matrix
You must be logged in to submit a solution.