#include <bits/stdc++.h>
#define fir first
#define sec second
#define PB push_back
#define MP make_pair

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i < (int)(n); ++i)
#define foreach(itr, c) for (__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); ++itr)

template <class T> void chkmax(T& x, T y) { x = (x > y ? x : y); }
template <class T> void chkmin(T& x, T y) { x = (x < y ? x : y); }

typedef long long LL;
typedef pair <int, int> pii;
typedef vector <int> vi;

const int N = 105;
const int M = 1e4 + 5;

int n, m, a[M], b[M], c[N];
vi e[N];
set <int> e2[N];
bool vis[N];

void dfs(int now, int from){
    vis[now] = 1;
    for (auto u : e[now]) if (u != from && c[u] == c[now]){
        if (e2[u].find(now) != e2[u].end()) continue;
        e2[now].insert(u);
        if (!vis[u]) dfs(u, now);
    }
}

int main(){
    scanf("%d%d", &n, &m);
    rep(i, m){
        scanf("%d%d", &a[i], &b[i]), a[i]--, b[i]--;
        e[a[i]].PB(b[i]);
        e[b[i]].PB(a[i]);
    }
    rep(i, n) scanf("%d", &c[i]);
    rep(i, m){
        if (c[a[i]] > c[b[i]]) e2[a[i]].insert(b[i]);
        else if (c[a[i]] < c[b[i]]) e2[b[i]].insert(a[i]);
        else {
            if (e2[a[i]].find(b[i]) != e2[a[i]].end() || e2[b[i]].find(a[i]) != e2[b[i]].end())
                continue;
            dfs(b[i], a[i]);
        }
    }

    rep(i, m){
        if (e2[a[i]].find(b[i]) != e2[a[i]].end()) printf("->\n");
        else printf("<-\n");
    }
    return 0;
}
#include<bits/stdc++.h>
#define it register int
#define ct const int
#define il inline
using namespace std;
typedef long long ll;
#define rll register ll
#define cll const ll
typedef double db;
#define rdb register db
#define cdb const db
typedef long double ldb;
typedef unsigned long long ull;
#define pb push_back
#define mkp make_pair
#define pl pair<ll,int> 
#define pi pair<int,int>
#define fir first
#define sec second
namespace io{
	il char nc(){
		static char buf[100000],*p1=buf,*p2=buf;
		return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++; 
	}
	template <class I> 
	il void fr(I &num){
		num=0;register char c=nc();it p=1;
		while(c<'0'||c>'9') c=='-'?p=-1,c=nc():c=nc();
		while(c>='0'&&c<='9') num=num*10+c-'0',c=nc();
		num*=p;
	}
	char obuf[1000001],*os=obuf, *ot=obuf+1000001;
	il void flush(){fwrite(obuf,1,os-obuf,stdout),os=obuf;}
	il void ptc(const char x){*os++=x,os==ot?flush():void();}
	template<class I>
	il void wr(I x){
		x<0?ptc('-'),x=-x:0;
		static char qu[65];
		char *tmp=qu;
		do *tmp++=(x%10)^'0';while(x/=10);
		while(tmp--!=qu) ptc(*tmp);
	}
	struct flusher{ ~flusher() { flush(); } }_;
	template <class I> 
	il I Max(I p,I q){return p>q?p:q;}
	template <class I> 
	il I Min(I p,I q){return p<q?p:q;}
	template <class I> 
	il I A(I x){return x<0?-x:x;}
	template <class I> 
	il void sp(I&p,I&q){I x=p;p=q,q=x;}
	template <class I>
	il void ckMax(I&p,I q){p=(p>q?p:q);}
	template <class I>
	il void ckMin(I&p,I q){p=(p<q?p:q);}
};
using io :: fr;
using io :: nc;
using io :: wr;
using io :: ptc;
using io :: Max;
using io :: Min;
using io :: A;
using io :: sp;
using io :: ckMax;
using io :: ckMin; 
const int N=1000005;
int h[N],nxt[N],adj[N],x[N],y[N],t=1,u,v,dfn[N],a[N],fa[N],tag[N],ans[N],ti,n,m,d[N],s[N],top,ins[N],id[N];
il void add(ct u,ct v,ct i){nxt[++t]=h[u],h[u]=t,adj[t]=v,id[t]=i,nxt[++t]=h[v],h[v]=t,adj[t]=u,id[t]=i;}
il void dfs(ct x){
	dfn[x]=++ti;//s[++top]=x,d[x]=top,ins[x]=1;
	//printf("x=%d\n",x);
	for(it i=h[x],j;i;i=nxt[i])
		if((j=adj[i])^fa[x]){
			if(dfn[j]) tag[id[i]]=x;
			if(!dfn[j]) tag[id[i]]=j,fa[j]=x,dfs(j);
		//	printf("x=%d x[i]=%d y[i]=%d tag[i]=%d\n",x,::x[i>>1],y[i>>1],tag[i>>1]);
		//	if(tag[i>>1]==1&&(!ans[i>>1])) (::x[i>>1]==x)?ans[i>>1]=1:ans[i>>1]=-1;
		//	if(tag[i>>1]==2&&(!ans[i>>1])) (::x[i>>1]==x)?ans[i>>1]=1:ans[i>>1]=-1;
		}
	//--top,ins[x]=0;
}
int main(){
	scanf("%d%d",&n,&m);it i;
	for(i=1;i<=m;++i) scanf("%d%d",&x[i],&y[i]);
	for(i=1;i<=n;++i) scanf("%d",&a[i]);
	for(i=1;i<=m;++i) if(a[x[i]]==a[y[i]]) add(x[i],y[i],i);
	for(i=1;i<=n;++i) if(!dfn[i]) ti=0,dfs(i);
	for(i=1;i<=m;++i){
		if(a[x[i]]>a[y[i]]){puts("->");continue;}
		if(a[x[i]]<a[y[i]]){puts("<-");continue;}
	//	printf("tag[i]=%d x[i]=%d y[i]=%d %d %d\n",tag[i],x[i],y[i],d[x[i]],d[y[i]]);
		//if(tag[i]==1) (dfn[x[i]]<dfn[y[i]])?puts("->"):puts("<-");
		//if(tag[i]==2) (dfn[x[i]]>dfn[y[i]])?puts("->"):puts("<-");
		if(tag[i]==x[i]) puts("<-");
		else puts("->");
		//if(ans[i]>0) puts("->");
		//else puts("<-");
	}
	return 0;
}
