a,b = input().split() c,d = "F","F" if b == "T": c = "T" if a == "T": d = "T" print(c,d)