SeriousOJ Challenge

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

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

LU IUJPC : Sylhet Division 2024 Replay Contest

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
11
Start at
2024-12-10 09:00
End at
2024-12-10 14:00
Duration
5.0 hour(s)
Host
Partic.
63