while 1: s='' for x in raw_input().split()[::-2]:s='<%s>'%x+s+''%x print s