void Test(int n)
{
int M,N;
for(int i=1;i<=n;i++)
{
cin>>M>>N;
int val=0 , temp=0;
int sphone , tphone;
while(M > temp || N>val)
{
cin>>sphone;
temp=sphone+temp;
cin>>tphone;
val=tphone+val;
}
cout<<temp<<endl;
cout<<val<<endl;
if(temp > M )
{
cout<<"Harshit"<<endl;
}
if(val>N)
{
cout<<"Aayush"<<endl;
}
}
}
int main()
{
int n;
cin>>n;
Test(n);
return 0;
}