// 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;

#ifdef LOCAL
#include "../debug.h"
#else
#define debug(x...) 141
#endif
#define forn(i,x,n) for(int i = x; i < n; ++i)
#define forit(it, m) for(auto it = m.begin(); it!=m.end(); ++it)
typedef long long ll;

ll n,m,k,x,y,p=1e9+7,invm;

void mult(vector<vector<ll>>& a, vector<vector<ll>>& b){
	vector<vector<ll>> c(n,vector<ll>(n));
	forn(i,0,n)
		forn(j,0,n)
			forn(k,0,n)
				c[i][j]+=a[i][k]*b[k][j], c[i][j]%=p;
	swap(a,c);
}

vector<vector<ll>> power(vector<vector<ll>>& F, int N){
	vector<vector<ll>> res(n,vector<ll>(n));
	forn(i,0,n)
		res[i][i]=1;
	while(N){
		if(N%2)
			mult(res,F);
		mult(F,F);
		N/=2;
	}
	return res;
}

int inv(ll m){
	ll res=1, n=p-2;
	while(n){
		if(n%2)
			res*=m, res%=p;
		m*=m, m%=p;
		n/=2;
	}
	return res;
}

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

    cin>>n>>m>>k;
    invm = inv(2ll*m);
    vector<vector<ll>> adj(n,vector<ll>(n)), a(n,vector<ll>(1));
    vector<int> deg(n);
    forn(i,0,n)
    	cin>>a[i][0];
    forn(_,0,m){
    	cin>>x>>y, x--, y--;
    	adj[x][y]=adj[y][x]=invm, deg[x]++, deg[y]++;
    }
    forn(i,0,n)
    	adj[i][i]=(p*p+1-deg[i]*invm)%p;
    adj = power(adj,k);
    mult(adj,a);
    forn(i,0,n)
    	cout<<adj[i][0]<<'\n';
    
    return 0;
}