SeriousOJ Challenge

SeriousOJ Challenge

Time Limit: 1.0 s

Memory Limit: 256.0 MB

Description

In a coding competition, there’s a challenge that all participants love to take on. The challenge is named "SeriousOJ"! To pass the challenge, participants need to find out if the string "SeriousOJ" is hidden somewhere in their submitted code, in a specific order.

You are given a string S of length N. Your task is to determine whether the string "SeriousOJ" exists as a subsequence in the given string S. A subsequence is a sequence that appears in the same relative order but not necessarily consecutively.
For example, "SeriousOJ" is a subsequence of "SSeeriiouusOJJ", as we can remove the extra characters but still maintain the order of the characters in "SeriousOJ".

Input

The first line of input contains an integer T (1 ≤ T ≤ 1000), the number of test case.
In each test case,
The first line of input contains an integer N (1 ≤ N ≤ 100000), the length of the string S.
The second line of input contains a string S of length N ,consisting of uppercase and lowercase English alphabets.

Sum of N overall test case doesn't exceed \(10^5\)

Output

In each test case, Print "YES" if the string "SeriousOJ" is a subsequence of S, otherwise, Print "NO".

Sample

Input Output

3
12
aSeeriousOBJ
12
caberiousOJS
16
SSSaaaeriousoOfJ

YES
NO
YES

Information

ID
1147
Difficulty
1
Category
(None)
Tags
(None)
# Submissions
88
Accepted
66
Accepted Ratio
75%
Uploaded By