#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> T >> A >> B; ll dist = max(A, B); // たどり着けない if(T"); T -= 3; } // T%2 == 0 FOR(i, 0, T/2){ p("<"); p(">"); } return 0; } ll diff = (T-dist)%2; if(diff==1){ // 1歩、無駄に消費したい if(A>B){ p(">"); x++; }else{ p("^"); y++; } T--; } // 貪欲に近づく while(T--){ ll dx = B-x; ll dy = A-y; if(dx==0 && dy==0){ p("0){ command += ">"; x++; }else if(dx<0){ command += "<"; x--; } if(dy>0){ command += "^"; y++; }else if(dy<0){ command += "v"; y--; } p(command); } } return 0; }