#include <bits/stdc++.h>
using std::cerr;using std::cin;using std::cout;using std::abs;using std::min;using std::max;using std::swap;using std::map;using std::unordered_map;using std::unordered_set;using std::bitset;using std::pair;using std::set;using std::string;using std::vector;using std::sort;using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;template<typename T>void _(const char*s,T h){cerr<<s<<" = "<<h<<"\n";}template<typename T,typename...Ts>void _(const char*s,T h,Ts...t){int b=0;while(((b+=*s=='(')-=*s==')')!=0||*s!=',')cerr<<*s++;cerr<<" = "<<h<<",";_(s+1,t...);}// break continue pop_back 998244353
#define int ll
#define pii pll
#define f first
#define s second
#define pb emplace_back
#define forn(i,n) for(int i=0;i<(n);++i)
#define sqr(x) ((x)*(x))
struct init{init(){cin.tie(0);std::iostream::sync_with_stdio(0);cout<<std::fixed<<std::setprecision(10);cerr<<std::fixed<<std::setprecision(5);}~init(){
#ifdef LOCAL
#define dbg(...) _(#__VA_ARGS__,__VA_ARGS__)
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#else
#define dbg(...) 
#endif
}}init;template<typename T,typename U>void upx(T&x,U y){if(x<y)x=y;}template<typename T,typename U>void upn(T&x,U y){if(x>y)x=y;}
#ifndef LOCAL
const int N=50005;
#else
const int N=5;
#endif
bitset<N> dp1[N];
int a[N+N],b[N+N];
int u[N];
char ans[N+N];
int dp[N+N][8];
int32_t main(){
    int n,m,q;
    cin>>n>>m>>q;
    forn(i,m){
        cin>>a[i]>>b[i];
        --a[i];--b[i];
        ans[i]='v';
    }
    if(q==1){
        forn(i,n)dp1[i].set(i);
        for(int i=m-1;i>=0;--i){
            dp1[a[i]]|=dp1[b[i]];
            dp1[b[i]]|=dp1[a[i]];
        }
        bitset<N> res=dp1[0];
        forn(i,n){
            res&=dp1[i];
        }
        if(res.none()){
            cout<<"-1\n";
        }else{
            int s=res._Find_first();
            u[s]=1;
            for(int i=m-1;i>=0;--i){
                if(u[a[i]]){
                    ans[i]='^';
                    u[b[i]]=1;
                }else if(u[b[i]]){
                    ans[i]='v';
                    u[a[i]]=1;
                }else{
                    ans[i]='v';                    
                }
            }
            forn(i,m)cout<<ans[i];
            cout<<'\n';
        }
    }else{
        if(n==2)cout<<"-1\n";
        else{
            vector<int> v;
            forn(i,m){
                if(a[i]>2||b[i]>2)ans[i]='^';
                else v.pb(i);
            }
            dp[0][7]=1;
            forn(p,v.size()){
                int i=v[p];
                int k=3^a[i]^b[i];
                forn(mask,8){
                    if(dp[p][mask]){
                        if(mask>>k&1){
                            {
                                int go=(1<<k)+(1<<b[i]);
                                dp[p+1][go]=mask;
                            }
                            {
                                int go=(1<<k)+(1<<a[i]);
                                dp[p+1][go]=mask;
                            }
                        }
                    }
                }
            }
            int x=v.size(),y;
            forn(i,8)if(dp[x][i])y=i;
            while(x){
                int i=v[x-1];
                if(!(y>>b[i]&1))ans[i]='^';
                else ans[i]='v';
                y=dp[x][y];
                x--;
            }
            forn(i,m)cout<<ans[i];
            cout<<'\n';
        }
    }
    return 0;
}


Measured memory_bytes: 307968