def random_walk(data): i = 1 t = 0 for i in range(len(data) - 1): if data[i] + 1 == abs(data[i + 1]) or data[i] - 1 == abs(data[i + 1]): t = t + 1 if t == len(data) - 2 and data[1] != 0: print("T") else: print("F") data = input() random_walk(data)