n = int(input(""))
for _ in range(n):
    m = int(input(""))
    l = list(input(""))
    di = {}
    for i in l:
        di[i] = l.count(i)
    x = list(di.values())
    print(x)
    m = max(x)
    a = len(l)-m
    print(m, a)
    if(m > a):
        m = a+1
    print(m+a)

b380ff850c4e6e7a6fe3dc1ac7336a5f5d003fbd
<mask token>

<mask token>
for _ in range(n):
    m = int(input(''))
    l = list(input(''))
    di = {}
    for i in l:
        di[i] = l.count(i)
    x = list(di.values())
    print(x)
    m = max(x)
    a = len(l) - m
    print(m, a)
    if m > a:
        m = a + 1
    print(m + a)

n = int(input(''))
for _ in range(n):
    m = int(input(''))
    l = list(input(''))
    di = {}
    for i in l:
        di[i] = l.count(i)
    x = list(di.values())
    print(x)
    m = max(x)
    a = len(l) - m
    print(m, a)
    if m > a:
        m = a + 1
    print(m + a)

n = int(input(""))
for _ in range(n):
    m = int(input(""))
    l = list(input(""))
    di = {}
    for i in l:
        di[i] = l.count(i)
    x = list(di.values())
    print(x)
    m = max(x)
    a = len(l)-m
    print(m, a)
    if(m > a):
        m = a+1
    print(m+a)
