import sys
import math
import bisect
import atexit
import io
from collections import defaultdict
MOD = int(1e9+7)


# n = map(int, raw_input().split())
# input = map(int, raw_input().split())
def fMod(x, nn, m):

    re = 1
    for ty in range(nn):
        re = (re*x)%m
    return re

n = map(int, raw_input().split())[0]
for i in range(n):
    t = map(int, raw_input().split())[0]
    s = raw_input()
    i, j = -1, -1
    for idx, c in enumerate(s):
        if c == '>':
            i = idx
            break
    for idx, c in enumerate(s):
        if c == '<':
            j = idx
            break
    print i,j
    if i == -1:
        print 0
    elif j == -1:
        print 0
    else:
        print 1
