P13297 [CodeChef] ct03
NOI
题目描述

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

输入格式

见题面

输出格式

见题面

样例输入
2 EPPEP EPPPPEE
样例输出
2 1 3 1