Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.

Today he wrote string $s$ of length $n$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $s$ is the correct spelling of his name.


-----Input-----

The first line of the input contains an integer $t$ ($1 \leq t \leq 10^3$) — the number of test cases.

The first line of each test case contains an integer $n$ $(1 \leq n \leq 10)$ — the length of string $s$.

The second line of each test case contains a string $s$ consisting of only uppercase or lowercase Latin characters.


-----Output-----

For each test case, output "YES" (without quotes) if $s$ satisfies the condition, and "NO" (without quotes) otherwise.

You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).


-----Examples-----

Input
10
5
Timur
5
miurT
5
Trumi
5
mriTu
5
timur
4
Timr
6
Timuur
10
codeforces
10
TimurTimur
5
TIMUR
Output
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO


-----Note-----

None

Difficulty: EASY

Solutions:
for _ in range(int(input())):
	a = int(input())
	b = input()
	if a == 5 and 'T' in b and ('i' in b) and ('m' in b) and ('u' in b) and ('r' in b):
		print('YES')
	else:
		print('NO')


def solve():
	n = int(input())
	s = input().strip()
	if n == 5 and ('T' in s and 'i' in s and ('m' in s) and ('u' in s) and ('r' in s)):
		return 'YES'
	return 'NO'
for _ in range(int(input())):
	ans = solve()
	print(ans)


for s in [*open(0)][2::2]:
	print('YNEOS'[sorted(s) != [*'\nTimru']::2])


l = list('Timur')
l.sort()
t = int(input())
for _ in range(t):
	(n,) = map(int, input().split())
	s = list(input())
	s.sort()
	if s == l:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	s = 'Timur'
	l1 = list(s)
	l1.sort()
	l2 = int(input())
	l2 = list(str(input()))
	l2.sort()
	if l1 == l2:
		print('YES')
	else:
		print('NO')


t = int(input())
name_in = 'Timur'
for _ in range(t):
	size = int(input())
	name = input()
	equal = sorted(name_in) == sorted(name)
	if equal:
		print('YES')
	else:
		print('NO')


t = int(input())
for T in range(t):
	n = int(input())
	s = input()
	name = 'Timur'
	flag = True
	if n == len(name):
		for i in range(n):
			if name[i] in s:
				flag = True
			else:
				flag = False
				break
	else:
		flag = False
	if flag == False:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	f = 0
	l = ['T', 'i', 'm', 'u', 'r']
	for i in s:
		if len(l) == 0:
			f = 1
			break
		if i in l:
			l.remove(i)
		else:
			f = 1
			break
	if len(l) == 0 and f == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	a = int(input())
	s = input()
	if a == 5:
		if 'T' in s and 'i' in s and ('m' in s) and ('u' in s) and ('r' in s):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	t -= 1


z = []
for i in range(int(input())):
	m = int(input())
	s = str(input())
	if m != 5:
		z.append('NO')
	elif 'T' in s and 'i' in s and ('m' in s) and ('u' in s) and ('r' in s):
		z.append('YES')
	else:
		z.append('NO')
print(*z, sep='\n')


x = {'T', 'i', 'm', 'u', 'r'}
cases = int(input())
for i in range(cases):
	temp = set()
	l = input()
	w = input()
	for j in w:
		if j in temp:
			temp.add('A')
		temp.add(j)
	if temp == x:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	w = input()
	t = w.count('T')
	r = w.count('r')
	i = w.count('i')
	u = w.count('u')
	m = w.count('m')
	c = 0
	if t == 1 and r == 1 and (i == 1) and (u == 1) and (m == 1):
		c = 5
	if c == 5 and n == 5:
		print('YES')
	else:
		print('NO')


def main():
	n = int(input())
	l2 = []
	for i in range(n):
		x = int(input())
		str1 = input()
		l1 = list(str1)
		if x == 5:
			if 'T' in l1 and 'i' in l1 and ('m' in l1) and ('u' in l1) and ('r' in l1):
				l2.append('YES')
			else:
				l2.append('NO')
		else:
			l2.append('NO')
	for i in l2:
		print(i)
main()


for i in range(int(input())):
	n = int(input())
	a = str(input())[:n]
	list1 = list(map(str, str(a)))
	list1.sort()
	b = 'Timur'
	list2 = list(map(str, str(b)))
	list2.sort()
	if list1 == list2:
		print('YES')
	else:
		print('NO')


def is_valid_spelling(s):
	return len(s) == 5 and s.count('T') == 1 and (s.count('i') == 1) and (s.count('m') == 1) and (s.count('u') == 1) and (s.count('r') == 1)

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		s = input()
		print('YES' if is_valid_spelling(s) else 'NO')
main()


a = int(input())
x = 'Timur'
z = {'i': 1, 'T': 1, 'm': 1, 'u': 1, 'r': 1}
for i in range(a):
	l = int(input())
	d = {}
	s = input()
	for i in s:
		if i in d:
			d[i] += 1
		else:
			d[i] = 1
	if d == z:
		print('YES')
	else:
		print('NO')


valid_names = ['T', 'i', 'm', 'u', 'r']
a = int(input())
while a != 0:
	s = int(input())
	name = input()
	visited = {'T': 0, 'i': 0, 'm': 0, 'u': 0, 'r': 0}
	flag = True
	if s == 5:
		for i in range(5):
			if name[i] in valid_names and visited[name[i]] == 0:
				visited[name[i]] += 1
			else:
				flag = False
		if flag == True:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	a -= 1


import sys
from itertools import permutations
perms = set(permutations('Timur'))

def run():
	t = int(input())
	lines = [x.strip() for x in sys.stdin.readlines()]
	i = 0
	while i < len(lines):
		n = int(lines[i])
		i += 1
		w = lines[i]
		i += 1
		if n != 5 or tuple((c for c in w)) not in perms:
			print('NO')
		else:
			print('YES')
run()


for testcase in range(int(input())):
	n = int(input())
	s = input()
	if sorted(s) == sorted('Timur'):
		if n == 5:
			print('Yes'.upper())
		else:
			print('No'.upper())
	else:
		print('No'.upper())


def main():
	num_test_cases = int(input())
	for _ in range(num_test_cases):
		length_name = int(input())
		name = str(input())
		if length_name == 5 and sorted(name) == sorted('Timur'):
			print('YES')
		else:
			print('NO')
main()


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	if sorted(s) == sorted('Timur'):
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
N = int(input())
check = ['T', 'i', 'm', 'u', 'r']
for i in range(N):
	M = int(input())
	case = list(input().rstrip())
	if M != 5:
		print('NO')
		continue
	if set(case) == set(check):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	if n > 5:
		print('NO')
		continue
	if 'T' in s and 'i' in s and ('m' in s) and ('u' in s) and ('r' in s) and (len(s) == 5):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	st = input()
	if n != 5:
		print('NO')
	else:
		l = ['T', 'i', 'm', 'u', 'r']
		try:
			for i in st:
				l.remove(i)
		except ValueError:
			pass
		if l == []:
			print('YES')
		else:
			print('NO')


import sys
input = sys.stdin.readline
output = sys.stdout.write

def checker(n):
	return ord(n)

def main():
	tests = int(input().rstrip())
	for i in range(tests):
		dic_ = {'T': 1, 'i': 1, 'm': 1, 'u': 1, 'r': 1}
		length_ = int(input().rstrip())
		if length_ != 5:
			output('NO')
			output('\n')
			input()
			continue
		else:
			str_ = input().rstrip()
			state = True
			for r in str_:
				if r in dic_ and dic_[r] == 1:
					dic_[r] += 1
				else:
					state = False
					output('NO')
					break
			if state:
				output('YES')
			output('\n')
main()


t = int(input())
timur = {'T': 1, 'i': 1, 'm': 1, 'u': 1, 'r': 1}
for x in range(t):
	n = int(input())
	s = str(input())
	d = dict()
	for el in s:
		if el not in d:
			d[el] = 0
		d[el] += 1
	print('YES' if d == timur else 'NO')


s = ['T', 'i', 'm', 'r', 'u']
for _ in range(int(input())):
	n = input()
	w = input()
	if n != '5':
		print('NO')
	else:
		w = sorted(w)
		if w == s:
			print('YES')
		else:
			print('NO')


import sys
sys.setrecursionlimit(10 ** 6)
ip = sys.stdin.readline
op = sys.stdout.write
t = int(ip())
res = []
for _ in range(t):
	n = int(ip())
	s = ip()
	if n != 5:
		res.append('NO')
	elif 'T' in s and 'i' in s and ('m' in s) and ('u' in s) and ('r' in s):
		res.append('YES')
	else:
		res.append('NO')
for val in res:
	op(val + '\n')


for i in range(int(input())):
	n = int(input())
	a = set(input())
	if a == {'T', 'i', 'm', 'u', 'r'} and n == 5:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline

def print(*args, end='\n', sep=' ') -> None:
	sys.stdout.write(sep.join(map(str, args)) + end)

def Solve():
	for t in range(int(input())):
		n = int(input())
		a = input()
		if n != 5:
			print('NO')
		else:
			for i in 'Timur':
				if i not in a:
					print('NO')
					break
			else:
				print('YES')
Solve()


def solve():
	for _ in range(int(input())):
		input()
		s = ''.join(sorted(input()))
		if s == 'Timru':
			print('YES')
		else:
			print('NO')
w = 1
while w > 0:
	w -= 1
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	if n != 5:
		print('NO')
	elif s.count('T') == 1 and s.count('i') == 1 and (s.count('m') == 1) and (s.count('u') == 1) and (s.count('r') == 1):
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	s = input()
	if n == 5 and 'T' in s and ('i' in s) and ('u' in s) and ('m' in s) and ('r' in s):
		print('YES')
	else:
		print('NO')


import sys, threading
import heapq
_input = sys.stdin.readline
hpop = heapq.heappop
hpush = heapq.heappush

def _print(*argv, sep=' '):
	sys.stdout.write(sep.join(map(str, argv)) + '\n')

def outbool(val):
	return 'YES' if val else 'NO'

def inp():
	return int(_input())

def inlt():
	return list(map(int, _input().split()))

def insr():
	s = _input()
	return list(s.strip())

def invr():
	return map(int, _input().split())

def solve():
	n = inp()
	target = sorted(list('Timur'))
	s = insr()
	_print(outbool(target == sorted(s)))

def main():
	t = inp()
	for _ in range(t):
		solve()
sys.setrecursionlimit(1 << 30)
threading.stack_size(1 << 27)
main_thread = threading.Thread(target=main)
main_thread.start()
main_thread.join()


a = [[int(input()), input()] for i in range(int(input()))]
for i in a:
	if i[0] == 5 and 'T' in i[1] and ('i' in i[1]) and ('m' in i[1]) and ('u' in i[1]) and ('r' in i[1]):
		print('YES')
	else:
		print('NO')


t = int(input())
mp = dict()
for _ in range(t):
	n = int(input())
	s = input()
	mp['T'] = 1
	mp['i'] = 1
	mp['m'] = 1
	mp['u'] = 1
	mp['r'] = 1
	if n != 5:
		print('NO')
		continue
	flag = True
	for i in s:
		if mp.get(i, 0) == 1:
			mp[i] -= 1
		else:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	if n != 5:
		print('NO')
		continue
	l = list(s)
	l.sort()
	if l == sorted(list('Timur')):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	m = 'Timru'
	res = ''.join(sorted(s))
	if str(res) == m:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	k = int(input())
	name = input()
	if k == 5 and sorted(name) == sorted('Timur'):
		print('YES')
	else:
		print('NO')


i = int(input())
b = []
name = ['T', 'i', 'm', 'u', 'r']
for x in range(i):
	l = int(input())
	z = input()
	if l != 5:
		b.append(0)
	else:
		check = True
		for n in range(5):
			if name[n] not in z:
				b.append(0)
				check = False
				break
		if check is True:
			b.append(1)
for x in b:
	if x == 0:
		print('NO')
	elif x == 1:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	s = input()
	l = ['T', 'i', 'm', 'u', 'r']
	l.sort()
	if sorted(s) == l:
		print('YES')
	else:
		print('NO')


num = int(input())
original = 'Timur'
for i in range(num):
	lenz = int(input())
	spell = input()
	if lenz != 5:
		print('NO')
	else:
		isTrue = True
		for j in range(lenz):
			if not spell.__contains__(original[j]):
				print('NO')
				isTrue = False
				break
		if isTrue:
			print('YES')


t = int(input(''))
if t >= 1 and t <= 1000:
	m = []
	for f in range(0, t):
		m.append('0')
	for i in range(0, t):
		l = int(input(''))
		if l >= 1 and l <= 10:
			s = input('')
			count1 = count2 = count3 = count4 = count5 = 0
			for j in range(0, l):
				if s[j] == 'T':
					count1 += 1
				elif s[j] == 'i':
					count2 += 1
				elif s[j] == 'm':
					count3 += 1
				elif s[j] == 'u':
					count4 += 1
				elif s[j] == 'r':
					count5 += 1
			if count1 == 1 & count2 == 1 & count3 == 1 & count4 == 1 & count5 == 1 and l == 5:
				m[i] = 'YES'
			else:
				m[i] = 'NO'
		else:
			print('')
	for k in range(0, t):
		print(m[k])
else:
	print('')


t = int(input())
result = []
for i in range(t):
	n = int(input())
	s = set(input())
	if s == set('Timur') and n == 5:
		result.append('YES')
	else:
		result.append('NO')
print(*result, sep='\n')


for t in [*open(0)][2::2]:
	print('YNEOS'[sorted(t) != [*'\nTimru']::2])


n = int(input())
results = []
for i in range(n):
	length = int(input())
	case = input()
	if sorted(case) == sorted('miurT'):
		results.append('YES')
	else:
		results.append('NO')
for result in results:
	print(result)


def check(s):
	if len(s) == 5:
		if s.count('T') == 1 and s.count('i') == 1 and (s.count('m') == 1) and (s.count('u') == 1) and (s.count('r') == 1):
			print('YES')
			return 0
		else:
			print('NO')
			return 0
	else:
		print('NO')
		return 0
t = int(input())
while t > 0:
	n = int(input())
	s = input()
	check(s)
	t -= 1


t = int(input())
word = list('Timur')
word.sort()
for i in range(t):
	l = int(input())
	word2 = list(input())
	if l == len(word):
		word2.sort()
		if word == word2:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
answer = [''] * t
f = 0
while t > 0:
	n = int(input())
	s = input()
	if n > 5:
		answer[f] = 'NO'
	else:
		s = ''.join(sorted(s))
		if s == 'Timru':
			answer[f] = 'YES'
		else:
			answer[f] = 'NO'
	t -= 1
	f += 1
for i in range(f):
	print(answer[i])


t = int(input())
while t > 0:
	x = int(input())
	name = input()
	if x != 5:
		print('NO')
	elif 'T' in name:
		if 'i' in name:
			if 'm' in name:
				if 'u' in name:
					if 'r' in name:
						print('YES')
					else:
						print('NO')
				else:
					print('NO')
			else:
				print('NO')
		else:
			print('NO')
	else:
		print('NO')
	t = t - 1


for _ in range(int(input())):
	n = int(input())
	string = input()
	add = 0
	if n != 5:
		print('NO')
	else:
		if int(string.find('T')) != -1:
			add += 1
		if int(string.find('i')) != -1:
			add += 1
		if int(string.find('m')) != -1:
			add += 1
		if int(string.find('u')) != -1:
			add += 1
		if int(string.find('r')) != -1:
			add += 1
		if add == 5:
			print('YES')
		else:
			print('NO')


t = int(input())
s1 = 'Timur'
a = []
for i in range(t):
	n = int(input())
	s2 = input()
	sum1 = 0
	sum2 = 0
	for j in range(n):
		if s2[j] in s1:
			sum1 += 1
	for j in range(len(s1)):
		if s1[j] in s2:
			sum2 += 1
	if sum1 == len(s1) and sum2 == len(s2):
		a.append('YES')
	else:
		a.append('NO')
for i in range(len(a)):
	print(a[i])


n = int(input())
l = []
for i in range(0, n):
	b = input()
	a = input()
	if len(a) == 5 and a.count('T') == 1 and (a.count('i') == 1) and (a.count('m') == 1) and (a.count('u') == 1) and (a.count('r') == 1):
		l.append('YES')
	else:
		l.append('NO')
for j in l:
	print(j)


for i in range(int(input())):
	c = 0
	l = int(input())
	inp = input()
	name = 'Timur'
	if len(inp) > 5:
		print('NO')
	else:
		for i in name:
			if i in inp:
				c += 1
		print('YES' if c == 5 else 'NO')


n = int(input())
for i in range(n):
	l = int(input())
	s = input()
	if l != 5:
		print('NO')
	elif 'T' in s and 'i' in s and ('m' in s) and ('u' in s) and ('r' in s):
		print('YES')
	else:
		print('NO')


T = int(input())
t = set('Timur')
for i in range(T):
	n = int(input())
	name = set(input())
	if n == len(t) and t == name:
		print('YES')
	else:
		print('NO')


ops = []
for _ in range(int(input())):
	n = int(input())
	s = input()
	if n != 5:
		ops.append('NO')
	else:
		v = 'Timur'
		f = 0
		for i in v:
			if i not in s:
				ops.append('NO')
				f = 1
				break
		if f == 0:
			ops.append('YES')
for op in ops:
	print(op)


t = int(input())
for i in range(t):
	input()
	c = input()
	print('YES' if sorted(c) == sorted('Timur') else 'NO')


import itertools
correct_names = []
for name in itertools.permutations('Timur'):
	s = ''
	for i in range(len(name)):
		s += name[i]
	correct_names.append(s)
res = []
k = int(input())
for i in range(k):
	n = int(input())
	input_name = input()
	if input_name in correct_names:
		res.append('YES')
	else:
		res.append('NO')
for i in range(len(res)):
	print(res[i])


from sys import stdin
n = int(stdin.readline().strip())

def check(zz, zzz):
	for i in zz:
		if i not in zzz:
			return False
		del zzz[zzz.index(i)]
	return True
for i in range(n):
	z = ['T', 'i', 'm', 'u', 'r']
	a = int(stdin.readline().strip())
	b = str(stdin.readline().strip())
	if a == 5:
		if check(b, z) == True:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


a = int(input())
d = []
e = ['T', 'i', 'm', 'u', 'r']
e.sort()
for i in range(a):
	b = int(input())
	c = input()
	s = []
	for i in c:
		s.append(i)
	s.sort()
	if s == e:
		d.append('YES')
	else:
		d.append('NO')
for i in d:
	print(i)


t = int(input())
YN = []
n = 'NO'
y = 'YES'
ch = 0
for i in range(t):
	s = int(input())
	name = input()
	namel = list(name)
	if s != 5 or name.count('T') == 0 or name.count('T') > 1:
		YN.append(n)
	elif name.isupper() == True:
		YN.append(n)
	elif (name.count('i') == 0 or name.count('i') > 1) or (name.count('m') == 0 or name.count('m') > 1) or (name.count('u') == 0 or name.count('u') > 1) or (name.count('r') == 0 or name.count('r') > 1):
		YN.append(n)
	else:
		YN.append(y)
for i in range(t):
	print(YN[i])


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	s = sorted(s)
	e = ['T', 'i', 'm', 'r', 'u']
	if e == s:
		print('YES')
	else:
		print('NO')


t = int(input())
name = set(['T', 'i', 'm', 'u', 'r'])
for i in range(t):
	l = int(input())
	if l != 5:
		print('NO')
		input()
		continue
	s = set(list(input()))
	if s == name:
		print('YES')
	else:
		print('NO')


for S in [*open(0)][2::2]:
	print('YNEOS'[sorted(S) != [*'\nTimru']::2])


for _ in range(int(input())):
	n = int(input())
	s = input().strip()
	if n != 5:
		print('NO')
	else:
		sub = 'Timur'
		res = 1
		for i in sub:
			if i not in s:
				res = 0
				break
		if res:
			print('YES')
		else:
			print('NO')


t = int(input())
res = []
for i in range(t):
	n = int(input())
	k = 1
	letra = list('Timur')
	word = input()
	for l in word:
		if n < len(letra):
			k = 0
			break
		if l in letra:
			letra.remove(l)
		else:
			k = 0
			break
	if k == 0:
		res.append('NO')
	else:
		res.append('YES')
for i in res:
	print(i)


t = int(input())
while t:
	n = int(input())
	s = input()
	se = ['T', 'i', 'm', 'u', 'r']
	ans = True
	if n != 5:
		ans = False
	else:
		for i in range(n):
			if s[i] not in se:
				ans = False
			else:
				se.remove(s[i])
	if ans:
		print('YES')
	else:
		print('NO')
	t = t - 1