# -*- coding: utf-8 -*- a,b = input().split() d = 'T' if a=='T' else 'F' c = 'T' if b=='T' else 'F' print(c,d)