MY CODE PLZ SEE THE SOLVE FUNCTION
#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL),cout.tie(NULL)
#define PI 3.141592653589793238462
#define MOD 1000000007
#define INF 1e18
#define nl ‘\n’
#define pb push_back
#define ppb pop_back
#define f first
#define s second
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define py cout << “YES” << nl
#define pn cout << “NO” << nl
#define loop(i,a,b) for (int i = a; i <= b; i++)
#define rloop(i,a,b) for (int i = a; i >= b; i–)
#define tc(t) int t; cin >> t; while (t–)
#define prec(n) fixed<<setprecision(n)
#define ini(a, i) memset(a, i, sizeof(a))
#define lli long long int
#define us unordered_set
#define um unordered_map
#define ll long long
#define ull unsigned long long
#define maxpq priority_queue
#define pii pair<int, int>
#define minpq priority_queue<int, vector, greater >
#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x<<" "; _print(x); cerr << endl;
#else
#define debug(x);
#endif
void _print(ll t) {cerr << t;}
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(double t) {cerr << t;}
void _print(ull t) {cerr << t;}
void google(int t) {cout << “Case #” << t << ": ";}
template <class T, class V> void _print(pair <T, V> p);
template void _print(vector v);
template void _print(set v);
template <class T, class V> void _print(map <T, V> v);
template void _print(multiset v);
template <class T, class V> void _print(pair <T, V> p) {cerr << “{”; _print(p.f); cerr << “,”; _print(p.s); cerr << “}”;}
template void _print(vector v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << “]”;}
template void _print(set v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << “]”;}
template void _print(multiset v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << “]”;}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << “]”;}
vector<vector> pre(int N){
vector<vector> divs(N);
loop(i, 1, N-1){
for(int j=i;j<N;j+=i)
divs[j].pb(i);
}
return divs;
}
vector sieve(int n) {intarr = new intn + 1; vector vect; for (int i = 2; i <= n; i++)if (arr[i] == 0) {vect.push_back(i); for (int j = 2 * i; j <= n; j += i)arr[j] = 1;} return vect;}
ll gcd(ll a, ll b) {if (b > a) {return gcd(b, a);} if (b == 0) {return a;} return gcd(b, a % b);}
ll add(ll x, ll y, ll m) {ll res=x+y; return res>=m ? res-m:res;}
ll mul(ll x, ll y, ll m) {ll res=xy; return res>=m? res%m:res;}
ll sub(ll x, ll y, ll m) {ll res=x-y; return res<0? res+m:res;}
ll power(ll x, ll y, ll m) {ll res=1; x%=m; while(y){ if (y&1) res=mul(res, x, m); y >>=1; x=mul(x, x, m);} return res;}
void solve(){
tc(t){
lli n,k;
cin>>n>>k;
string x;
cin>>x;
string y=x;
string z=x;
lli l=0;
lli u=0;
transform(y.begin(),y.end(),y.begin(),::tolower);
transform(z.begin(),z.end(),z.begin(),::toupper);
loop(i,0,x.length()-1){
if(x[i]==y[i]){
l++;
}
else if(x[i]==z[i]){
u++;
}
}
if(k>=l && k>=u){
cout<<"both"<<nl;
}
else if(k<l && k<u){
cout<<"none"<<nl;
}
else{
if(k>=l){
cout<<"brother"<<nl;
}
else{
cout<<"chef"<<nl;
}
}
}
}
int main(){
#ifndef ONLINE_JUDGE
freopen(“input.txt”, “r”, stdin);
freopen(“output.txt”, “w”, stdout);
#endif
#ifndef ONLINE_JUDGE
freopen(“Error.txt”, “w”, stderr);
#endif
fio;
auto start1 = high_resolution_clock::now();
solve();
auto stop1 = high_resolution_clock::now();
auto duration = duration_cast(stop1 - start1);
#ifndef ONLINE_JUDGE
cerr << "Time: " << duration . count() / 1000 << endl;
#endif
}