// Problem: 
// 			D - Orientation
// 			
// 		
// Contest: AtCoder - AtCoder Regular Contest 111
// URL: https://atcoder.jp/contests/arc111/tasks/arc111_d
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i,x,n) for(int i = x;i <= n;++i)	

const int N = 105,M = N * N;
int g[N][N],a[M],b[M],c[N];
bool st[N];
int n,m;

void dfs(int u)
{
	st[u] = 1;
	forn(i,1,n)
	{
		if(!g[u][i])	continue;
		g[i][u] = 0;
		if(!st[i])	dfs(i);
	}
}

int main()
{
	ios::sync_with_stdio(0);cin.tie(0);
	cin >> n >> m;
    forn(i,1,m)	cin >> a[i] >> b[i];
    forn(i,1,n)	cin >> c[i];
    
    vector<string> ans(m + 1,"");
    forn(i,1,m)
    {
    	if(c[a[i]] > c[b[i]])	ans[i] = "->";
    	else if(c[a[i]] < c[b[i]])	ans[i] = "<-";
    	else
    	{
    		g[a[i]][b[i]] = 1;
    		g[b[i]][a[i]] = 1;
    	}
    }
    
	forn(i,1,n)	if(!st[i])    dfs(i);
	forn(i,1,m)
	{
		if(ans[i] != "")	continue;
		if(g[a[i]][b[i]])	ans[i] = "->";
		else				ans[i] = "<-";
	}
	
	forn(i,1,m)	cout << ans[i] << endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define endl '\n'

int n, m;
int a[5055], b[5055];
int dir[5055];
int c[155];
bool used[155];
int dfn[155], t;

vector<pair<int, int>> g[155];

void dfs(int v) {
    used[v] = true;
    dfn[v] = t++;

    for (auto p: g[v]) {
        if (dir[p.second >> 1] == -1) {
            dir[p.second >> 1] = p.second & 1;
        }
        if (!used[p.first]) {
            dfs(p.first);
        }
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n >> m;

    for (int i = 0; i < m; i++) {
        cin >> a[i] >> b[i];
        a[i]--, b[i]--;
    }

    for (int i = 0; i < n; i++) cin >> c[i];

    memset(dir, -1, sizeof(dir));

    for (int i = 0; i < m; i++) {
        if (c[a[i]] > c[b[i]]) {
            dir[i] = 0;
        }
        if (c[a[i]] < c[b[i]]) {
            dir[i] = 1;
        }
    }

    for (int i = 0; i < m; i++) if (dir[i] == -1) {
        g[a[i]].emplace_back(b[i], i * 2);
        g[b[i]].emplace_back(a[i], i * 2 + 1);
    }

    for (int i = 0; i < n; i++) if (!used[i]) {
        dfs(i);
    }

    for (int i = 0; i < m; i++) cout << (dir[i] == 0 ? "->" : "<-") << endl;
}