*CodeChef recently revamped its [practice page] to make it easier for users to identify the next problems they should solve by introducing some new features:*
*Recent Contest Problems - Contains only problems from the last 2 contests*
*Separate Un-Attempted,  Attempted, and All tabs*
*Problem Difficulty Rating - The Recommended dropdown menu has various difficulty ranges so that you can attempt the problems most suited to your experience*
*Popular Topics and Tags*

Chef has been participating regularly in rated contests but missed the last two contests due to his college exams. He now wants to solve them and so he visits the practice page to view these [problems]. 

Given a list of N contest codes, where each contest code is either START38 or LTIME108, help Chef count how many problems were featured in each of the contests. 

------ Input Format ------ 

- First line will contain T, number of test cases. Then the test cases follow.
- Each test case contains of two lines of input.
- First line of input contains the total count of problems that appeared in the two recent contests - N.
- Second line of input contains the list of N contest codes. Each code is either START38 or LTIME108, to which each problem belongs.

------ Output Format ------ 

For each test case, output two integers in a single new line - the first integer should be the number of problems in START38, and the second integer should be the number of problems in LTIME108.

------ Constraints ------ 

$1 ≤ T ≤ 10$
$1 ≤ N ≤ 1000$
- Each of the contest codes will be either START38 or LTIME108.

----- Sample Input 1 ------ 
4
3
START38 LTIME108 START38
4
LTIME108 LTIME108 LTIME108 START38
2
LTIME108 LTIME108
6
START38 LTIME108 LTIME108 LTIME108 START38 LTIME108

----- Sample Output 1 ------ 
2 1
1 3
0 2
2 4

----- explanation 1 ------ 
Test case $1$: There are $2$ START38s in the input, which means that there were $2$ problems in START38. Similarly, there was $1$ problem in LTIME108.

Test case $2$: There is $1$ START38 in the input, which means that there was $1$ problem in START38. Similarly, there were $3$ problems in LTIME108.

Test case $3$: There are no START38s in the input, which means that were $0$ problems in START38. Similarly, there were $2$ problems in LTIME108.

Test case $4$: There are $2$ START38s in the input, which means that there were $2$ problems in START38. Similarly, there were $4$ problems in LTIME108.

Source: codechef | Difficulty: EASY
Tags: Data structures


Solutions:
for i in range(int(input())):
	n = int(input())
	l = list(input().split())
	a = 0
	b = 0
	for i in l:
		if i == 'START38':
			a += 1
		else:
			b += 1
	print(a, b)


for _ in range(int(input())):
	n = int(input())
	c = list(map(str, input().split()))
	a = c.count('START38')
	b = c.count('LTIME108')
	print(f'{a} {b}')


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(str, input().strip().split()))
	a = 0
	b = 0
	if 'START38' in arr:
		a = arr.count('START38')
	if 'LTIME108' in arr:
		b = arr.count('LTIME108')
	print(a, b)


for _ in range(int(input())):
	n = int(input())
	arr = [str(i) for i in input().split()][:n]
	aSTART38 = arr.count('START38')
	aLTIME108 = arr.count('LTIME108')
	print(aSTART38, aLTIME108)


for i in range(int(input())):
	N = int(input())
	l = input().split()
	a = 0
	b = 0
	for i in l:
		if i == 'START38':
			a = l.count('START38')
		elif i == 'LTIME108':
			b = l.count('LTIME108')
	print(a, b)


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(str, input().split()))
	count_38 = 0
	count_108 = 0
	for i in range(len(l)):
		if l[i] == 'START38':
			count_38 = count_38 + 1
		else:
			count_108 = count_108 + 1
	print(count_38, end=' ')
	print(count_108)


t = int(input())
for i in range(0, t):
	n = int(input())
	c1 = 0
	c2 = 0
	l1 = list(map(str, input().split()))
	for j in l1:
		if j[0] == 'S':
			c1 += 1
		else:
			c2 += 1
	print(c1, c2)


t = int(input())
for i in range(t):
	n = int(input())
	b = list(input().split())
	count = 0
	no = 0
	for i in b:
		if i == 'START38':
			count = count + 1
		else:
			no = no + 1
	print(count, no)


for i in range(int(input())):
	n = int(input())
	l = list(map(str, input().split()))
	c = 0
	c1 = 0
	for i in l:
		if i == 'START38':
			c += 1
		else:
			c1 += 1
	print(c, end=' ')
	print(c1)


t = int(input())
while t != 0:
	n = int(input())
	list1 = list(map(str, input().split()))
	print(list1.count('START38'), list1.count('LTIME108'))
	t -= 1


for i in range(int(input())):
	cs = 0
	cl = 0
	n = int(input())
	val = input().split()
	for k in range(n):
		if val[k] == 'START38':
			cs += 1
		elif val[k] == 'LTIME108':
			cl += 1
		else:
			pass
	print(cs, cl)


t = int(input())
for _ in range(t):
	a = int(input())
	b = list(input().split())
	l = 0
	m = 0
	for i in b:
		if i == 'START38':
			l += 1
		else:
			m += 1
	print(l, m)


for _ in range(int(input())):
	n = int(input())
	s = input().split()
	count = 0
	count2 = 0
	for i in s:
		if i == 'START38':
			count += 1
		else:
			count2 += 1
	print(count, count2)


for _ in range(int(input())):
	n = int(input())
	s = input()
	scount = s.count('START38')
	lcount = s.count('LTIME108')
	print(scount, lcount)


T = int(input())
for i in range(T):
	N = int(input())
	A = list(input().split())
	B = 0
	C = 0
	for i in A:
		if i == 'START38':
			B += 1
		else:
			C += 1
	print(B, C)


t = int(input())
for i in range(t):
	n = int(input())
	x = list(input().split())
	c1 = c2 = 0
	for j in x:
		if j == 'START38':
			c1 += 1
		else:
			c2 += 1
	print(c1, c2)


for i in range(int(input())):
	x = int(input())
	y = list(map(str, input().split()))
	j = 0
	a = 0
	b = 0
	while j < x:
		if y[j] == 'START38':
			a += 1
		else:
			b += 1
		j += 1
	print(a, b)


p = int(input())
for a in range(p):
	t = int(input())
	l = list(map(str, input().split()))
	(a1, a2) = (0, 0)
	for i in l:
		if i == 'START38':
			a1 += 1
		else:
			a2 += 1
	print(a1, a2)


t = int(input())
for i in range(t):
	a = int(input())
	j = list(input().split())
	S = 0
	b = 0
	for i in j:
		if i == 'START38':
			S = S + 1
		else:
			b = b + 1
	print(S, b)


T = int(input())
for i in range(T):
	N = int(input())
	S = input()
	l = list(map(str, S.split()))
	count1 = 0
	count2 = 0
	for j in l:
		if 'START' in j:
			count1 += 1
		else:
			count2 += 1
	print(f'{count1} {count2}')


n = int(input())
for i in range(n):
	a = int(input())
	s = 0
	x = 0
	l = input().split()
	for i in l:
		if i.startswith('S'):
			s = s + 1
		elif i.startswith('L'):
			x = x + 1
	print(s, x)


vp = int(input())
for i in range(vp):
	n = int(input())
	t = list(input().split())
	c = 0
	z = 0
	for i in t:
		if i == 'START38':
			c = c + 1
		elif i == 'LTIME108':
			z = z + 1
	print(c, z)


for i in range(int(input())):
	N = int(input())
	L = input().split(' ')
	A = 0
	B = 0
	for j in range(N):
		if L[j] == 'START38':
			A += 1
		elif L[j] == 'LTIME108':
			B += 1
	print(A, B)


n = int(input())
for i in range(n):
	num = int(input())
	a = list(input().split())
	c1 = 0
	c2 = 0
	for j in a:
		if j == 'START38':
			c1 = c1 + 1
		if j == 'LTIME108':
			c2 = c2 + 1
	print(c1, c2)


t = int(input())
for i in range(t):
	n = int(input())
	s = input().split()
	cnt1 = 0
	cnt2 = 0
	for i in range(n):
		if s[i] == 'START38':
			cnt1 += 1
		else:
			cnt2 += 1
	print(cnt1, cnt2)


for i in range(int(input())):
	n = int(input())
	k = input().split(' ')
	s = k.count('START38')
	l = k.count('LTIME108')
	print(s, l)


for i in range(int(input())):
	n = int(input())
	l = list(map(str, input().split()))
	a = l.count('START38')
	b = l.count('LTIME108')
	print(a, b)


t = int(input())
for i in range(t):
	n = int(input())
	lst = list(map(str, input().split()))
	s = 0
	l = 0
	for i in lst:
		if i == 'START38':
			s += 1
		else:
			l += 1
	print(s, l)


for _ in range(int(input())):
	n = int(input())
	a = input().split()
	s = 0
	l = 0
	for i in a:
		if i[0] == 'S':
			s += 1
		else:
			l += 1
	print(s, l)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(input())
	c = 0
	b = 0
	for i in range(len(a)):
		if a[i] == 'S':
			c += 1
		elif a[i] == 'L':
			b += 1
	print(c, b)


for i in range(int(input())):
	count = 0
	add = 0
	b = int(input())
	z = []
	z = list(input().split())
	for i in z:
		if i == 'LTIME108':
			count = count + 1
		else:
			add = add + 1
	print(add, count)


for i in range(int(input())):
	n = int(input())
	a = list(input().split())
	s = 0
	d = 0
	for i in a:
		if i == 'START38':
			s += 1
		if i == 'LTIME108':
			d += 1
	print(s, d)


for i in range(int(input())):
	n = int(input())
	a = input().split()
	c = 0
	b = 0
	for i in range(n):
		if a[i] == 'LTIME108':
			b += 1
		else:
			c += 1
	print(c, b)


t = int(input())
for _ in range(t):
	N = int(input())
	list1 = input().split()
	a = 0
	b = 0
	for i in list1:
		if i == 'START38':
			a += 1
		else:
			b += 1
	print(a, b)


t = int(input())
cnt = 0
tot = 0
for i in range(0, t):
	n = int(input())
	s = list(map(str, input().split()))
	st = s.count('START38')
	lt = s.count('LTIME108')
	print(st, lt)


def count_problems(n, contests):
	start38 = 0
	ltime108 = 0
	for contest in contests:
		if contest == 'START38':
			start38 += 1
		else:
			ltime108 += 1
	return (start38, ltime108)
t = int(input())
for i in range(t):
	n = int(input())
	contests = input().split()
	(start38, ltime108) = count_problems(n, contests)
	print(start38, ltime108)


n = int(input())
for i in range(n):
	m = int(input())
	l = list(map(str, input().split()))
	c1 = 0
	c2 = 0
	for j in l:
		if j == 'START38':
			c1 = c1 + 1
		else:
			c2 += 1
	print(c1, ' ', c2)


t = int(input())
for j in range(t):
	x = int(input())
	l = list(map(str, input().split()))
	c = 0
	d = 0
	for i in l:
		if i == 'START38':
			c = c + 1
		else:
			d = d + 1
	print(c, d)


for i in range(int(input())):
	n = int(input())
	l1 = list(input().split())
	s = 0
	l = 0
	for i in l1:
		if i == 'START38':
			s += 1
		else:
			l += 1
	print(s, l)


T = int(input())
for i in range(T):
	N = int(input())
	code = [str(i) for i in input().split()][:N]
	c1 = code.count('START38')
	c2 = code.count('LTIME108')
	print(c1, c2)


n = int(input())
for i in range(n):
	size = int(input())
	arr = list(map(str, input().split(' ')))
	l1 = 'START38'
	s1 = 'LTIME108'
	c1 = 0
	c2 = 0
	for i in arr:
		if i == l1:
			c1 = c1 + 1
		if i == s1:
			c2 = c2 + 1
	print(c1, c2)


T = int(input())
for i in range(T):
	N = int(input())
	c = list(input().split())
	d = 0
	e = 0
	for j in c:
		if j == 'LTIME108':
			d = d + 1
		else:
			e = e + 1
	print(e, d)


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(str, input().split()))
	c = 0
	for i in range(n):
		if l[i] == 'START38':
			c = c + 1
	print(c, n - c)


t = int(int(input()))
for i in range(t):
	n = int(input())
	s = input()
	x = s.count('START38')
	y = s.count('LTIME108')
	print(x, y)


t = int(input())
c = 0
a = 0
for i in range(t):
	n = int(input())
	l = list(input().split(' '))
	b = len(l)
	c = 0
	a = 0
	for j in range(b):
		if l[j] == 'START38':
			c += 1
		else:
			a += 1
	print(c, a)


for _ in range(int(input())):
	a = int(input())
	b = list(input().split())
	c = 0
	p = 0
	for i in b:
		if i == 'START38':
			c = c + 1
		else:
			p = p + 1
	print(c, p)


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(str, input().split()))
	count = 0
	count1 = 0
	l = ['START38']
	l2 = ['LTIME108']
	for i in arr:
		if i in l:
			count += 1
	for j in arr:
		if j in l2:
			count1 += 1
	print(count, count1)


for i in range(0, int(input())):
	x = int(input())
	a = list(input().split())
	b = 'START38'
	c = 'LTIME108'
	d = 0
	e = 0
	for i in a:
		if i == b:
			d = d + 1
		elif i == c:
			e = e + 1
	print(d, end=' ')
	print(e)


T = int(input())
for _ in range(T):
	n = int(input())
	l = list(map(str, input().split()))[:n]
	print(l.count('START38'), l.count('LTIME108'))


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(str, input().split()))[:n]
	print(l.count('START38'), l.count('LTIME108'))


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(str, input().split()))
	l2 = []
	c = 0
	d = 0
	for i in range(0, len(l)):
		if l[i] == 'START38':
			c += 1
		else:
			d += 1
	l2.append(c)
	l2.append(d)
	print(*l2)


for j in range(int(input())):
	c = 0
	d = 0
	n = input()
	code = input().split()
	for i in code:
		if i == 'START38':
			c += 1
		elif i == 'LTIME108':
			d += 1
	print(c, d)


for _ in range(int(input())):
	n = int(input())
	A = list(map(str, input().split()))[:n]
	c1 = 0
	for i in A:
		if i == 'START38':
			c1 += 1
	print(c1, n - c1)


for i in range(int(input())):
	n = int(input())
	l1 = list(map(str, input().split()))
	st = 0
	lt = 0
	for j in l1:
		if j == 'START38':
			st += 1
		else:
			lt += 1
	print(st, lt)


t = int(input())
for i in range(t):
	n = int(input())
	codes = input().split()
	start38_count = 0
	ltime108_count = 0
	for code in codes:
		if code == 'START38':
			start38_count += 1
		else:
			ltime108_count += 1
	print(start38_count, ltime108_count)


test = int(input())
while test > 0:
	a = int(input())
	problems = input().split()
	scount = 0
	lcount = 0
	for prob in problems:
		if prob == 'START38':
			scount += 1
		else:
			lcount += 1
	print('{} {}'.format(scount, lcount))
	test -= 1


t = int(input())
for i in range(t):
	P = int(input())
	n = list(input().split())
	S = 0
	L = 0
	for j in range(len(n)):
		if n[j] == 'START38':
			S += 1
		else:
			L += 1
	print(S, L)


test_case = int(input())
for i in range(0, test_case):
	n = int(input())
	l = map(str, input().split())
	star_count = 0
	ltime_count = 0
	for i in l:
		if i == 'START38':
			star_count += 1
		else:
			ltime_count += 1
	print('%s %s' % (star_count, ltime_count))


n = int(input())
for e in range(n):
	f = int(input())
	li = list(input().split())
	es = 0
	os = 0
	for r in li:
		if r == 'START38':
			es = es + 1
		else:
			os = os + 1
	print(es, os)


t = int(input())
for i in range(t):
	n = int(input())
	s = list(input().split())
	x = 0
	y = 0
	for i in s:
		if i == 'START38':
			x = x + 1
		else:
			y = y + 1
	print(x, y)