------
## 最终结论
Here is the complete Python code to solve the problem:

```python
def find_sequences(t, test_cases):
    results = []
    for n, s in test_cases:
        # Minimum LIS
        min_seq = []
        stack = []
        current = 1
        for char in s + '>':  # Append '>' to handle the last element
            if char == '<':
                stack.append(current)
            else:
                stack.append(current)
                while stack:
                    min_seq.append(stack.pop())
            current += 1

        # Maximum LIS
        max_seq = []
        stack = []
        current = n
        for char in s + '<':  # Append '<' to handle the last element
            if char == '>':
                stack.append(current)
            else:
                stack.append(current)
                while stack:
                    max_seq.append(stack.pop())
            current -= 1

        results.append((min_seq, max_seq))
    
    return results

# Reading input and processing each test case
import sys
input = sys.stdin.read
data = input().split()

t = int(data[0])
index = 1
test_cases = []

for _ in range(t):
    n = int(data[index])
    s = data[index + 1]
    test_cases.append((n, s))
    index += 2

results = find_sequences(t, test_cases)

# Output the results
for min_seq, max_seq in results:
    print(' '.join(map(str, min_seq)))
    print(' '.join(map(str, max_seq)))
```

This code reads the input data, processes each test case to find the sequences with minimum and maximum possible lengths of the longest increasing subsequence (LIS), and then outputs these sequences. Each sequence respects the comparison constraints given by the string of '<' and '>' characters.