//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <functional>
#include <cstring>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <complex>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define itn int
#define nit int
#define ll long long
#define ms multiset
#define F(i,a,b) for(register int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(register int i=a,i##end=b;i>=i##end;--i)
#define re register
#define ri re int
#define il inline
#define pii pair<int,int>
#define cp complex<double>
//#pra gma G CC opti mize(3)
using namespace std;
using std::bitset;
//using namespace __gnu_pbds;
const double Pi=acos(-1);
namespace fastIO {
	template<class T>
	inline void read(T &x) {
		x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		if(fu)x=-x;
	}
	inline int read() {
		int x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		return fu?-x:x;
	}
	char _n_u_m_[40];
	template<class T>
	inline void write(T x ) {
		if(x==0) {
			putchar('0');
			return;
		}
		T tmp = x > 0 ? x : -x ;
		if( x < 0 ) putchar('-') ;
		register int cnt = 0 ;
		while( tmp > 0 ) {
			_n_u_m_[ cnt ++ ] = tmp % 10 + '0' ;
			tmp /= 10 ;
		}
		while( cnt > 0 ) putchar(_n_u_m_[ -- cnt ]) ;
	}
	template<class T>
	inline void write(T x ,char ch) {
		write(x);
		putchar(ch);
	}
}
using namespace fastIO;
int n,m,x[100002],y[1000002],p[100002];
int mp[1002][1002];
vector<int>g[100002];
struct node {
	int pos,c;
} s[102];
bool cmp(node x,node y){
	return x.c>y.c;
}bool vis[102];
inline void dfs(int pos){
	vis[pos]=1;
	F(i,0,g[pos].size()-1){if(s[g[pos][i]].c==s[pos].c)
		if(!vis[g[pos][i]]){
			mp[pos][g[pos][i]]=mp[g[pos][i]][pos]=pos;
			dfs(g[pos][i]);
		}else{
			if(!mp[pos][g[pos][i]])mp[pos][g[pos][i]]=mp[g[pos][i]][pos]=pos;
		}
	}
}
int main() {
	cin>>n>>m;
	F(i,1,m) {
		read(x[i]);
		read(y[i]);
		g[x[i]].push_back(y[i]);
		g[y[i]].push_back(x[i]);
	}
	F(i,1,n)s[i]=(node) {
		i,read()
	};
	F(i,1,n)if(!vis[i])dfs(i);
	F(i,1,n)
	{
		F(j,0,g[i].size()-1){
			if(s[g[i][j]].c<s[i].c){
				mp[i][g[i][j]]=mp[g[i][j]][i]=i;
			}
		}
	}F(i,1,m){
		if(mp[x[i]][y[i]]==x[i]){
			puts("->");
		}else{
			puts("<-");
		}
	}
	return 0;
}

#include<bits/stdc++.h> 
using namespace std ; 
#define fast_io                ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define debug(x)               cerr << #x << " -> " << x << "\n" 
#define here                   cerr << "here\n"
#define MP                     make_pair
#define F                      first
#define S                      second
typedef long long ll ; 
typedef pair<int ,int> pii ; 
constexpr int MAXN = 1e5 + 13 ; 
constexpr int MOD = 1e2 + 10 ; 
constexpr ll INF = 1e18 ; 

struct Edge {
	int u ,v ; 
};

int n ,m ,vis[MOD][MOD] ,c[MAXN] ,u ,v ,ans[MOD][MOD] ;
vector <int> G[MAXN] ;
Edge E[MAXN] ;   

void dfs(int u){
	for (auto v : G[u]){
		if (c[v] == c[u] && !vis[u][v]){
			vis[u][v] = 1 ,vis[v][u] = 1 ; 
			ans[u][v] = 1 ; 
			dfs(v) ; 
		}
	}
}

int main (){
	fast_io ; 
	cin >> n >> m ; 
	for (int i = 0 ;i < m ;i++){
		cin >> E[i].u >> E[i].v ; 
		G[E[i].u].push_back(E[i].v) ; 
		G[E[i].v].push_back(E[i].u) ; 
	}
	for (int i = 1; i <= n; i++){
		cin >> c[i] ; 
	}
	for (int i = 1; i <= n; i++){ 
		dfs(i) ; 
	}
	for (int i = 0; i < m; i++){
		if (c[E[i].u] > c[E[i].v] || ans[E[i].u][E[i].v]){
			cout << "->\n" ; 
		}
		else {
			cout << "<-\n" ; 
		}
	}
	return 0 ; 
}

/*
2 2 2 1 3 
2 2 2 3 1     

*/ 
