Problem: A balancing network is an abstract device built up of N wires, thought of as running from left to right, and M balancers that connect pairs of wires. The wires are numbered from 1 to N from top to bottom, and the balancers are numbered from 1 to M from left to right. Balancer i connects wires x_i and y_i (x_i < y_i).

pic1-small-2acea94b.png

Each balancer must be in one of two states: up or down.

Consider a token that starts moving to the right along some wire at a point to the left of all balancers. During the process, the token passes through each balancer exactly once. Whenever the token encounters balancer i, the following happens:

* If the token is moving along wire x_i and balancer i is in the down state, the token moves down to wire y_i and continues moving to the right.
* If the token is moving along wire y_i and balancer i is in the up state, the token moves up to wire x_i and continues moving to the right.
* Otherwise, the token doesn't change the wire it's moving along.



Let a state of the balancing network be a string of length M, describing the states of all balancers. The i-th character is `^` if balancer i is in the up state, and `v` if balancer i is in the down state.

A state of the balancing network is called uniforming if a wire w exists such that, regardless of the starting wire, the token will always end up at wire w and run to infinity along it. Any other state is called non-uniforming.

You are given an integer T (1 \le T \le 2). Answer the following question:

* If T = 1, find any uniforming state of the network or determine that it doesn't exist.
* If T = 2, find any non-uniforming state of the network or determine that it doesn't exist.



Note that if you answer just one kind of questions correctly, you can get partial score.

Constraints

* 2 \leq N \leq 50000
* 1 \leq M \leq 100000
* 1 \leq T \leq 2
* 1 \leq x_i < y_i \leq N
* All input values are integers.

Input

Input is given from Standard Input in the following format:


N M T
x_1 y_1
x_2 y_2
:
x_M y_M


Output

Print any uniforming state of the given network if T = 1, or any non-uniforming state if T = 2. If the required state doesn't exist, output `-1`.

Examples

Input

4 5 1
1 3
2 4
1 2
3 4
2 3


Output

^^^^^


Input

4 5 2
1 3
2 4
1 2
3 4
2 3


Output

v^^^^


Input

3 1 1
1 2


Output

-1


Input

2 1 2
1 2


Output

-1

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;

const int N = 5e4+5, M = 1e6+5;
int n,m;

int hed[M],cnt=1,to[M],nxt[M],cap[M],flow[M];
void adde(int u,int v,int _cap,int tpe=0){
	++cnt;to[cnt]=v,cap[cnt]=_cap,nxt[cnt]=hed[u],flow[cnt]=0;hed[u]=cnt;
	if(!tpe){++cnt;to[cnt]=u,cap[cnt]=0,nxt[cnt]=hed[v],flow[cnt]=0;hed[v]=cnt;}
}
namespace graph{
	int S,T;
	int d[M];bool vis[M];
	
	queue<int>Q;
	bool bfs(){
		memset(vis,0,sizeof(vis));
		memset(d,0,sizeof(d));
		Q.push(S);vis[S]=1;
		while(!Q.empty()){
			int u=Q.front();Q.pop();
			for(int i=hed[u];i;i=nxt[i]){
				int v=to[i];
				if(!vis[v]&&cap[i]>flow[i]){
					vis[v]=1,d[v]=d[u]+1;
					Q.push(v);
				}
			}
		}
		return vis[T];
	}
	int dfs(int u,int F){
		if(u==T||!F)return F;
		int flownow=0;
		for(int i=hed[u];i;i=nxt[i]){
			int v=to[i];if(d[v]!=d[u]+1)continue;
			int f=dfs(v,min(F,cap[i]-flow[i]));
			flownow+=f;
			F-=f;
			flow[i]+=f,flow[i^1]-=f;
			if(!F)break;
		}
		if(!flownow)d[u]=0;
		return flownow;
	}
	const int inf=0x3f3f3f3f;
	int max_flow(){
		int fw=0;
		while(bfs()){
			fw+=dfs(S,inf);
			if(fw>1)break;
		}
		return fw;
	}
}


int nd[M],col[M];

namespace Subtask_1{
	bitset<N> last[N];
	int u[M],v[M];
	bool vis[M];
	inline void mdfs(int x){
		for(int i=hed[x];i;i=nxt[i]){
			int vv=to[i];
			if(!vis[vv]){
				// cout << x << ":" << vv << endl;
				vis[vv]=1;
				mdfs(vv);
				if(v[vv]==u[x]||v[vv]==v[x])col[vv]=1;
			}
		}
	}
	inline void solve(){
		int flg=0;
		for(int i=1;i<=n;i++)last[i].set(i);
		for(int i=1;i<=m;i++){
			scanf("%d%d",&u[i],&v[i]);
			adde(i,nd[u[i]],0,1),adde(i,nd[v[i]],0,1);
			last[u[i]] = last[v[i]] = last[u[i]]|last[v[i]];
			nd[u[i]]=nd[v[i]]=i;
			if(last[u[i]].count()==(unsigned)n){
				mdfs(i);
				flg=1;
				goto END;
			}
		}
		END:;
		if(!flg)puts("-1");
		else{
			for(int i=1;i<=m;i++){
				printf("%c",col[i]?'v':'^');
			}puts("");
		}
		return;
	}
}

int ed[M];
int E[M][2];
namespace Subtask_2{
	int u[M],d[M];
	inline void solve(){
		graph::S=m*2+1,graph::T=m*2+2;
		for(int i=1;i<=m;i++){
			scanf("%d%d",&u[i],&d[i]);
		}
		for(int i=m;i;i--){
			adde(i,m+i,1);
			if(!nd[u[i]])adde(m+i,graph::T,1),ed[u[i]]=i;
			else adde(m+i,nd[u[i]],1);
			if(!nd[d[i]])adde(m+i,graph::T,1),ed[d[i]]=i;
			else adde(m+i,nd[d[i]],1);
			E[i][0]=nd[u[i]],E[i][1]=nd[d[i]];
			// cout << nd[u[i]] << ":" << nd[d[i]] << endl;
			nd[u[i]]=nd[d[i]]=i;
		}
		for(int i=1;i<=n;i++){
			if(!nd[i])adde(graph::S,graph::T,1);
			else adde(graph::S,nd[i],1);
		}
		int ret=graph::max_flow();
		if(ret<=1){
			puts("-1");
			return ;
		}
			// cout << ed[1] << ":" << ed[2] << " " << ed[3] << endl;
		for(int i=m+1;i<=m*2;i++){
			// int ccnt=0;
			for(int e=hed[i];e;e=nxt[e])if(cap[e]>0&&flow[e]>0){
				int v=to[e];
				if(v==m*2+2){
					if(ed[u[i-m]]==i-m)col[i-m]=0;
					else col[i-m]=1;
					continue;
				}else{
					// ++ccnt;
					// if(ccnt==2){cout << "Err" << endl;return;}
					if(E[i-m][1]==v)col[i-m]=1;
				}
			}
		}
		for(int i=1;i<=m;i++){
			// cout << (col[i]?d[i]:u[i]) << "::" << f[col[i]?d[i]:u[i]] << "|";
			printf("%c",col[i]?'v':'^');
			// puts("");
			// if(f[col[i]?d[i]:u[i]]==6){cout << i << endl;return;}
		}puts("");
	}
}

int T;
int main()
{
	// freopen("02-03.txt","r",stdin);
	cin >> n >> m >> T;
	if(T==1){
		Subtask_1::solve();
	}else{
		Subtask_2::solve();
	}
}
/*
3 7 2
1 3
1 2
1 2
2 3
1 3
2 3
1 2
1 3
1 3
2 3
2 3
1 2
2 3
2 3

4 8 2
1 3
1 3
2 4
1 2
1 2
3 4
2 3
2 3
 */