The name of our college is "Government College of Engineering and Textile Technology Berhampore". There is another college named "Government College of Engineering and Textile Technology Serampore". As the names are quite similar, those who are unaware of existence of both the colleges, often get confused. And mistake one with other.

Given a string, if it contains the word berhampore (case insensitive), print GCETTB or if it contains serampore(case-insensitive), print GCETTS . If the string contains neither print Others. If it contains both Berhampore and Serampore print Both 
Input 
- First line contains single integer T, No. of test case  
- Next line for every test contain case a string S 
Output

Print GCETTB or GCETTS or Others or Both on a new line
Constraints 
- 1 <= T <= 10 
- 0 <= len(S) <= 100  
- S contain a-z and A-Z and space only
Sample Input
3
Government clg Berhampore
SeRaMporE textile college 
Girls college Kolkata

Sample Output

GCETTB

GCETTS

Others       
Explanation

Self-Explanatory

Difficulty: UNKNOWN_DIFFICULTY

Solutions:
try:
	t = int(input())
	for i in range(t):
		n = input()
		n = n.lower()
		a = 'berhampore'
		b = 'serampore'
		if a in n:
			if b in n:
				print('Both')
			else:
				print('GCETTB')
		elif b in n:
			if a in n:
				print('Both')
			else:
				print('GCETTS')
		else:
			print('Others')
except Exception as e:
	pass


tc = int(input())
for i in range(tc):
	cllg = input()
	cllg = cllg.lower()
	cllglist = cllg.split()
	if 'berhampore' in cllglist and 'serampore' in cllglist:
		print('Both')
	elif 'berhampore' in cllglist:
		print('GCETTB')
	elif 'serampore' in cllglist:
		print('GCETTS')
	else:
		print('Others')


for _ in range(int(input())):
	s = input()
	check1 = 'berhampore'
	check2 = 'serampore'
	if check1 in s.casefold() and check2 in s.casefold():
		print('Both')
	elif check1 in s.casefold():
		print('GCETTB')
	elif check2 in s.casefold():
		print('GCETTS')
	else:
		print('Others')


t = int(input())
for _ in range(t):
	s = input()
	ss = s.lower()
	a = 'berhampore'
	b = 'serampore'
	if a in ss and b in ss:
		print('Both')
	elif a in ss:
		print('GCETTB')
	elif b in ss:
		print('GCETTS')
	else:
		print('Others')


def main():
	for _ in range(int(input().strip())):
		college_name = input().strip().lower()
		if 'berhampore' in college_name and 'serampore' in college_name:
			print('Both')
		elif 'berhampore' in college_name:
			print('GCETTB')
		elif 'serampore' in college_name:
			print('GCETTS')
		else:
			print('Others')

def __starting_point():
	main()
__starting_point()


t = int(input())
for i in range(t):
	try:
		s = str(input())
		s1 = s.lower()
		if 'berhampore' in s1 and 'serampore' not in s1:
			print('GCETTB')
		elif 'serampore' in s1 and 'berhampore' not in s1:
			print('GCETTS')
		elif 'berhampore' in s1 and 'serampore' in s1:
			print('Both')
		else:
			print('Others')
	except EOFError:
		print('Others')


try:
	for t in range(int(input())):
		inp = input().lower()
		b = False
		s = False
		for i in inp.split():
			if i == 'berhampore':
				b = True
			elif i == 'serampore':
				s = True
		if b and s:
			print('Both')
		elif b:
			print('GCETTB')
		elif s:
			print('GCETTS')
		else:
			print('Others')
except:
	pass


t = int(input())
for i in range(t):
	a = input()
	a = a.upper()
	b = a.find('BERHAMPORE', 0, len(a))
	c = a.find('SERAMPORE', 0, len(a))
	if b != -1 and c == -1:
		print('GCETTB')
	elif b == -1 and c != -1:
		print('GCETTS')
	elif b != -1 and c != -1:
		print('Both')
	elif b == -1 and c == -1:
		print('Others')


try:
	t = int(input())
	for _ in range(t):
		x = input().lower()
		if 'berhampore' in x and 'serampore' in x:
			print('Both')
		elif 'berhampore' in x:
			print('GCETTB')
		elif 'serampore' in x:
			print('GCETTS')
		else:
			print('Others')
except:
	pass


n = int(input())
for l in range(n):
	s = list(map(str, input().strip().split()))
	a = []
	for x in s:
		a.append(x.lower())
	if 'berhampore' in a and 'serampore' in a:
		print('Both')
	elif 'serampore' in a:
		print('GCETTS')
	elif 'berhampore' in a:
		print('GCETTB')
	else:
		print('Others')


for _ in range(int(input())):
	s = input().lower()
	if 'berhampore' in s and 'serampore' in s:
		print('Both')
	elif 'berhampore' in s:
		print('GCETTB')
	elif 'serampore' in s:
		print('GCETTS')
	else:
		print('Others')


t = int(input())
c = 0
d = 0
for i in range(t):
	c = 0
	d = 0
	s = input()
	l = s.split(' ')
	for j in range(len(l)):
		if l[j].lower() == 'berhampore':
			c += 1
		if l[j].lower() == 'serampore':
			d += 1
	if c > 0 and d > 0:
		print('Both')
	elif c > 0:
		print('GCETTB')
	elif d > 0:
		print('GCETTS')
	else:
		print('Others')


for i in range(0, int(input())):
	s = input()
	l = s.split(' ')
	p = 'berhampore'
	q = 'serampore'
	for i in range(0, len(l)):
		l[i] = l[i].lower()
	b = 0
	s = 0
	for i in l:
		if i == p:
			b += 1
		elif i == q:
			s += 1
	if b > 0 and s > 0:
		print('Both')
	elif s > 0:
		print('GCETTS')
	elif b > 0:
		print('GCETTB')
	else:
		print('Others')


for _ in range(int(input())):
	l = list(map(str, input().split()))
	k = []
	for i in l:
		k.append(i.lower())
	if 'berhampore' in k and 'serampore' in k:
		print('Both')
	elif 'serampore' in k and 'berhampore' not in k:
		print('GCETTS')
	elif 'serampore' not in k and 'berhampore' in k:
		print('GCETTB')
	else:
		print('Others')


for i in range(int(input())):
	val = list(map(str, input().split(' ')))
	for j in range(len(val)):
		val[j] = val[j].lower()
	if 'berhampore' in val and 'serampore' in val:
		print('Both')
	elif 'serampore' in val:
		print('GCETTS')
	elif 'berhampore' in val:
		print('GCETTB')
	else:
		print('Others')


T = int(input())
for i in range(T):
	s = input()
	s = s.lower()
	l = s.split()
	f1 = 0
	f2 = 0
	for j in l:
		if j == 'serampore':
			f1 = 1
		elif j == 'berhampore':
			f2 = 1
	if f1 == 1 and f2 == 1:
		print('Both')
	elif f1 == 1 and f2 == 0:
		print('GCETTS')
	elif f1 == 0 and f2 == 1:
		print('GCETTB')
	else:
		print('Others')


try:
	for _ in range(int(input())):
		s = input().lower().split()
		a = 0
		b = 0
		if 'berhampore' in s:
			a = 1
		if 'serampore' in s:
			b = 1
		if a == 1 and b == 1:
			print('Both')
		elif a == 1:
			print('GCETTB')
		elif b == 1:
			print('GCETTS')
		else:
			print('Others')
except:
	pass


t = int(input())
while t:
	t -= 1
	s = input()
	s = s.upper()
	if s.find('BERHAMPORE') != -1 and s.find('SERAMPORE') != -1:
		print('Both')
		continue
	if s.find('BERHAMPORE') != -1:
		print('GCETTB')
		continue
	elif s.find('SERAMPORE') != -1:
		print('GCETTS')
		continue
	else:
		print('Others')


import math
t = int(input())
for _ in range(t):
	f = 0
	s = input()
	r = s.lower()
	if 'berhampore' in r and 'serampore' in r:
		f = 1
		print('Both')
	if 'berhampore' in r:
		if f == 0:
			f = 1
			print('GCETTB')
	if 'serampore' in r:
		if f == 0:
			f = 1
			print('GCETTS')
	if f == 0:
		print('Others')


t = int(input())
for j in range(t):
	p = input()
	p = p.split(' ')
	flag = 'Others'
	for i in range(int(len(p))):
		if p[i].lower() == 'serampore':
			if flag == 'Others':
				flag = 'GCETTS'
			if flag == 'GCETTB':
				flag = 'Both'
		if p[i].lower() == 'berhampore':
			if flag == 'Others':
				flag = 'GCETTB'
			if flag == 'GCETTS':
				flag = 'Both'
	print(flag)


t = int(input())
for i in range(t):
	s = input()
	s = s.lower()
	s = s.split()
	if 'berhampore' in s and 'serampore' in s:
		print('Both')
	elif 'berhampore' in s:
		print('GCETTB')
	elif 'serampore' in s:
		print('GCETTS')
	else:
		print('Others')


T = int(input())
for t in range(T):
	s = input()
	s = s.lower()
	b_check = 'berhampore' in s
	s_check = 'serampore' in s
	if b_check and s_check:
		print('Both')
	elif b_check and (not s_check):
		print('GCETTB')
	elif not b_check and s_check:
		print('GCETTS')
	else:
		print('Others')