q=0 exec's=`input()`\nif q:print" ".join("^V"[x>y]for x,y in zip(q,s))\nfor c in s:s+=" %c "%"<>"[c