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