Priya is so much beautiful , everybody want to be in a relationship with her . So it 's the Valentine's day , many person come to propose her but she can't decide what to do . So she simply follow a rule the person which request her most will be selected by her. So you have to find the person which request her most.
The first line contains T - number of test cases . Each of next T lines contain a string S.
For each test case you need to print maximum occurring characters with their count followed by a single space.
1<=T<=50
1<=|S|<=100, where |S| denotes the length of string S.
Note : Output will be in sorted manner !
Here abc occurs same times : abc 2
Here a occurs maximum times then others : a 2
Here everyone has the same occurring frequency : abcdefgh 1