#include <iostream>
#include <string>
using namespace std;
int main()
{
int N;
cin>>N;
while(N>0)
{
string word;
cin>>word;
int a;
cin>>a;
int temp;
for(int j=0;j<a;j++)
{
int b;
cin>>b;
if(j==0)
{
temp=b;
continue;
}
if(word=="Faster")
{
if(temp>b)
temp=b;
}
if(word=="Higher")
{
if(temp<b)
temp=b;
}
if(word=="Stronger")
{
if(temp<b)
temp=b;
}
}
cout<<temp<<endl;
N--;
}
}
浙公网安备 33010602011771号