ct03_6291
Problem description.
Chef decides to distribute fancy stationary among kids. Chef has collection of erasers and pencils . Each kid needs to be given a pencil and eraser. Your job is to help find Chef how many kids can get the stationary and how many min pencils or erasers the chef will need to clear the stock that is left with him. 

Input
Input description.

The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
Each test case contains string made up of E and P.


Output
Output description.

For each test case, output a single line containing the number of kids he can give, no of min pencils or erasers needed.


Constraints

1 ≤ T ≤ 1000
String made up of E and P


Example
Input:
2
EPPEP
EPPPPEE

Output:
2 1
3 1


 Explaination
CASE 1: there are 2 erasers and 3 pencils. so chef can only give stationary to 2 students. For remaining 1 pencil he will need 1 more eraser to clear the stock
t = int(raw_input())

for i in range(0, t):
  string = raw_input()
  e = 0
  p = 0
  for j in range(0, len(string)):
    if string[j] == 'E':
      e += 1
    else:
      p += 1
  print min(e, p), max(e, p) - min(e, p)