m = [[0, 1], [0, 0]]
n = gets.to_i
arr = gets.chomp.gsub("T","0").gsub("F", "1").split.map(&:to_i)
answer = m[arr[0]][arr[1]]
2.upto(n - 1){|i| answer = m[answer][arr[i]]}
puts (answer == 0 ? "T" : "F")
