#include<bits/stdc++.h>
using namespace std;
void solve()
{
int n,ile_l = 0,ile_p = 0,ile_z = 0;
int gdz_l = -1,gdz_p = -1;
cin >> n;
string a;
cin >> a;
for(int i = 0;i < n;++i)
{
if(a[i] == 'P')
{
gdz_p = i;
}
if(a[i] == 'L')
{
gdz_l = i;
}
if(gdz_l != -1 && gdz_p != -1 && gdz_l > gdz_p)
{
if((gdz_l-gdz_p-1)%2 == 1)
{
ile_p +=
ile_z++;
}
ile_p += (gdz_l-gdz_p-1)/2;
ile_l += (gdz_l-gdz_p-1)/2;
gdz_l = -1;
gdz_p = -1;
}
}
char zna = 'L';
int gdz = -1;
for(int i = 0;i < n;++i)
{
if(a[i] == 'L')
{
if(zna == 'L')
{
ile_l += i-gdz;
}
else
ile_l++;
zna = 'L';
gdz = i;
}
if(a[i] == 'P')
{
zna = 'P';
gdz = i;
}
}
zna = 'P';
gdz = n;
for(int i = n-1;i >= 0;--i)
{
if(a[i] == 'P')
{
if(zna == 'P')
{
ile_p += gdz-i;
}
else
ile_p++;
zna = 'P';
gdz = i;
}
if(a[i] == 'L')
{
zna = 'L';
gdz = i;
}
}
ile_z += (n-ile_z-ile_p-ile_l);
cout<< ile_l << ' ' << ile_p << ' ' << ile_z << endl;
}
int main()
{
ios_base::sync_with_stdio(0);
int t;
cin >> t;
for(int i = 0;i < t;++i)
{
solve();
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCgp2b2lkIHNvbHZlKCkKewoJaW50IG4saWxlX2wgPSAwLGlsZV9wID0gMCxpbGVfeiA9IDA7CglpbnQgZ2R6X2wgPSAtMSxnZHpfcCA9IC0xOwoJY2luID4+IG47CglzdHJpbmcgYTsKCWNpbiA+PiBhOwoJZm9yKGludCBpID0gMDtpIDwgbjsrK2kpCgl7CgkJaWYoYVtpXSA9PSAnUCcpCgkJewoJCQlnZHpfcCA9IGk7CgkJfQoJCWlmKGFbaV0gPT0gJ0wnKQoJC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