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

const int N = 110;;
int a[N * N], b[N * N], c[N], mp[N][N];
int n, m;
bool vis[N];
string ans[N*N];

void dfs(int u) {
    vis[u] = true;
    for (int i = 1; i <= n; i++) {
        if (mp[u][i]) {
            mp[i][u] = false;
            if (!vis[i]) dfs(i);
        }
    }
}

int main() {
    cin >> n >> m;
    for (int i = 1; i <= m; i++)
        cin >> a[i] >> b[i];
    for (int i = 1; i <= n; i++)
        cin >> c[i];
    for (int i = 1; i <= m; i++) {
        if (c[a[i]] > c[b[i]]) ans[i] = "->";
        else if (c[b[i]] > c[a[i]]) ans[i] = "<-";
        else mp[a[i]][b[i]] = mp[b[i]][a[i]] = true;
    }
    for (int i = 1; i <= n; i++)
        if (!vis[i]) dfs(i);
    for (int i = 1; i <= m; i++) {
        if (mp[a[i]][b[i]]) ans[i] = "->";
        else if (mp[b[i]][a[i]]) ans[i] = "<-";
    }
    for (int i = 1; i <= m; i++)
        cout << ans[i] << endl;
    return 0;
}
//#pragma GCC optimize ("O2")
//#pragma GCC target ("avx2")
#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	int N, M;
	cin >> N >> M;
	vector<pair<int, int>> E[101];
	rep1(i, M) {
		int a, b;
		cin >> a >> b;
		E[a].pb({ b, i });
		E[b].pb({ a, -i });
	}
	int C[101];
	rep1(i, N) cin >> C[i];

	int vis[101] = {};
	int kotae[10000];
	rep1(i, N) {
		if (!vis[i]) {
			pair<int, int> Q[10000];
			int a = 0;
			Q[a++] = { i, 0 };
			while (a) {
				int fr = Q[--a].first;
				int mae = Q[a].second;
				if (vis[fr]) continue;
				vis[fr] = 1;
				for (auto p : E[fr]) {
					int to = p.first;
					int dotti = p.second;
					if (!vis[to]) {
						if (C[fr] == C[to]) {
							kotae[abs(dotti)] = dotti;
							Q[a++] = { to, fr };
						}
					}
					else if (mae != to) {
						kotae[abs(dotti)] = dotti;
					}
				}
			}
		}
		for (auto p : E[i]) {
			int to = p.first;
			int dotti = p.second;
			if (C[i] < C[to]) kotae[abs(dotti)] = -dotti;
			else if (C[i] > C[to]) kotae[abs(dotti)] = dotti;
		}

	}

	rep1(i, M) {
		if (kotae[i] > 0) co("->");
		else co("<-");
	}

	Would you please return 0;
}