from math import inf


def good(lst):
    result = inf
    a = list()
    for i in range(len(lst)):
        if lst[i][1] == '>':
            result = min(result, i - 1)
            a.append(result)
        else:
            result = min(result, lst[i][0] - i - 1)
            a.append(result)
    return a


t = int(input())
b = list()
for j in range(t):
    n = int(input())
    s = input()
    b.append([n, s])
print(*good(b), sep='\n')
