#include <iostream>
#include <vector>
#include <map>
using namespace std;
const int maxn = 1e2 + 10;
const int maxm = 1e4 + 10;
int n, m;
int c[maxn];
bool visited[maxn];
string ans[maxm];
vector<int> G[maxn];
vector<pair<int, int>> edge;
map<pair<int, int>, int> edge_ind;

void dfs(int v){
	visited[v] = true;
	for(int u : G[v]){
		if(c[u] == c[v]){
			int ind = edge_ind[{u, v}];
			if(ans[ind] == ""){
				if(edge[ind].first == v){
					ans[ind] = "->";
				}
				else{
					ans[ind] = "<-";
				}
			}
			if(!visited[u]){
				dfs(u);
			}
		}
	}
}

int main(){
	cin >> n >> m;
	for(int i = 0; i < m; i ++){
		int u, v;
		cin >> u >> v;
		u --, v --;
		G[u].push_back(v);
		G[v].push_back(u);
		edge.push_back({u, v});
		edge_ind[{u, v}] = edge_ind[{v, u}] = i;
	}
	for(int i = 0; i < n; i ++){
		cin >> c[i];
	}
	for(int i = 0; i < n; i ++){
		if(!visited[i]){
			dfs(i);
		}
	}
	for(int i = 0; i < m; i ++){
		if(c[edge[i].first] > c[edge[i].second]){
			ans[i] = "->";
		}
		if(c[edge[i].second] > c[edge[i].first]){
			ans[i] = "<-";
		}
	}
	for(int i = 0; i < m; i ++){
		cout << ans[i] << '\n';
	}
}
#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
constexpr ll MOD = 1'000'000'007LL; /*998'244'353LL;*/
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
template<class T> bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
constexpr int dy[4]={-1,0,1,0};
constexpr int dx[4]={0,-1,0,1};

int N, M;
int A[100*100], B[100*100];
int C[100];

vector<pair<int,int>> e[101];
vector<int> v[101];
int ans[100*100];

bool vis[100];
queue<int> que;
bool fin[100];
bool dfs(int n, int p, int b){
    if(vis[n]){
        if(n == p) return true;
        else return false;
    }
    vis[n] = true;
    rep(i, e[n].size()){
        if(C[n] != C[e[n][i].first]) continue;
        if(e[n][i].first == b) continue;
        bool ret = dfs(e[n][i].first, p, n);
        if(ret){
            fin[n] = true;
            ans[e[n][i].second] = n;
            que.push(n);
            return true;
        }
    }
    vis[n] = false;
    return false;
}
bool dfs2(int n, int p, int b){
    if(fin[n]) return true;
    if(vis[n]) return false;
    vis[n] = true;
    rep(i, e[n].size()){
        if(C[n] != C[e[n][i].first]) continue;
        if(e[n][i].first == b) continue;
        bool ret = dfs2(e[n][i].first, p, n);
        if(ret){
            fin[n] = true;
            ans[e[n][i].second] = n;
            que.push(n);
            return true;
        }
    }
    vis[n] = false;
    return false;
}

signed main(){
    cin >> N >> M;
    rep(i, M){
        cin >> A[i] >> B[i];
        A[i]--; B[i]--;
        e[A[i]].pb({B[i],i});
        e[B[i]].pb({A[i],i});
    }
    rep(i, N){
        cin >> C[i];
        v[C[i]].pb(i);
    }

    rep(i, 101){
        rep(j, v[i].size()){
            if(!fin[v[i][j]]){
                bool ret = dfs(v[i][j], v[i][j], -1);
            }
            while(que.size()){
                rep(k, e[que.front()].size()){
                    if(C[que.front()] != C[e[que.front()][k].first]) continue;
                    if(fin[e[que.front()][k].first]) continue;
                    dfs2(e[que.front()][k].first, que.front(), que.front());
                    ans[e[que.front()][k].second] = que.front();
                }
                que.pop();
            }
        }
    }

    rep(i, M){
        if(C[A[i]] > C[B[i]]) cout << "->" << endl;
        else if(C[A[i]] < C[B[i]]) cout << "<-" << endl;
        else{
            if(ans[i] == A[i]) cout << "->" << endl;
            else cout << "<-" << endl;
        }
    }
}