problem

There is a mysterious device $ M $, and if you put Tanuki and Fox in this device, one animal will come out from the device (hereinafter, Tanuki will be $ T $ and Fox will be $ F $).

$ M (x, y) $ represents an animal that came out by putting animals in the device $ M $ in the order of $ x, y $.

As a result of various trials, the following was found.


$ M (T, T) = T $
$ M (T, F) = F $
$ M (F, T) = T $
$ M (F, F) = T $



You put the animals in a row $ P_1, P_2, ..., P_N $ into the device as follows.
$ M (.... M (M (P_1, P_2), P_3) ...., P_N) $

Answer the last animal that appears.



output

Output the last animal character $ T $ or $ F $, and also a newline at the end.

Example

Input

3
F T T


Output

T
#include <bits/stdc++.h>
using namespace std;

enum An {
  T,
  F
};

An M(An a, An b){
  if(a == T && b == T){
    return T;
  }
  if(a == T && b == F){
    return F;
  }
  if(a == F && b == T){
    return T;
  }
  if(a == F && b == F){
    return T;
  }
}

int main(void){
  int N; cin >> N;
  vector<An> P(N);
  for(int i = 0; i < N; i++){
    char c; cin >> c;
    if(c == 'F'){
      P[i] = F;
    }else{
      P[i] = T;
    }
  }
  An current = M(P[0], P[1]);
  for(int i = 2; i < N; i++){
    current = M(current, P[i]);
  }
  if(current == T){
    cout << 'T' << endl;
  }else{
    cout << 'F' << endl;
  }
  return 0;
}

