r=raw_input s=r() while 1:t=s;print''.join(x+" %s "%'<>'[x>y]for x,y in zip(t,t[1:]))+t[-1];s=r();print' '.join('V^'[x>y]for x,y in zip(s,t))