#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--;
 }
}

posted on 2012-05-25 22:16  梨子  阅读(128)  评论(0)    收藏  举报