#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
struct node
{
double h;
double w;
} q[2000];
bool cmp(node a,node b)
{
return a.h<b.h;
}
int main()
{
int t,n;
int i,j;
while(cin>>t)
{
while(t--)
{
cin>>n;
for(i=1; i<=n; i++)
{
cin>>q[i].h>>q[i].w;
}
sort(q,q+n+1,cmp);
double s1=0;
double s2=0;
for(i=1; i<=n; i++)
{
if(i%2==1)
s1+=q[i].w;
if(i%2==0)
s2+=q[i].w;
}
if(s1==s2)
cout<<"fair"<<endl;
if(s1>s2)
cout<<"red"<<endl;
if(s1<s2)
cout<<"blue"<<endl;
}
//cout << "Hello world!" << endl;
}
return 0;
}