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