while~0:s=raw_input().split(' > ');print'<%s>'%'><'.join(s)]+s[::-1])