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